if(typeof(HTMLElement)!="undefined") //给firefox定义contains()方法,ie下不起作用
{
HTMLElement.prototype.contains=function(obj)
{
while(obj!=null&&typeof(obj.tagName)!="undefind"){ //通过循环对比来判断是不是obj的父元素
if(obj==this) return true;
obj=obj.parentNode;
}
return false;
};
}
function fun(e,o) {
/* FF 下判断鼠标是否离开DIV */
if(window.navigator.userAgent.indexOf("Firefox")>=1) {
if(o.contains(e.relatedTarget)==false)
{
o.style.display="none";
}
}
/* IE */
if(o.contains(event.toElement ) == false){}
}
</script>