if(typeof(HTMLElement)!="undefined")
{
HTMLElement.prototype.contains = function(obj)
{
while(obj!=null && typeof(obj.tagName)!="undefind")
{if(obj==this) return true; obj=obj.parentNode;} return false;
};
}
可以判断鼠标是否在某个控件的范围之内
{
HTMLElement.prototype.contains = function(obj)
{
while(obj!=null && typeof(obj.tagName)!="undefind")
{if(obj==this) return true; obj=obj.parentNode;} return false;
};
}
可以判断鼠标是否在某个控件的范围之内
这个是判断对象是否包含另外一个对象吧?相当于IE自带的contains方法