onmouseout found that its triggering was too sensitive. When passing through the text chain in the layer, the onmousetout event was triggered, and the function could not be displayed normally. After some searching, I sorted it out for your reference.
1.
2.
var LeaveFunext = function(t,f){for(var p in f){t[p]=f[p]} return t};
var IE = 'v' == 'v';
var contains = function(wrap,child){
if(IE) return wrap.contains(child);
while(child && typeof( child.parentNode) != "undefind"){
if(wrap == child) return true;
child = child.parentNode;
}
return false;
};
var LeaveFun = function(o){
var _o = typeof o == "string" ? document.getElementById(o) : o;
return this == window ? new LeaveFun(_o):LeaveFunext(_o , LeaveFun.prototype);
};
LeaveFun.prototype = {
mouseleave : function(fn){
if(IE){
this.attachEvent('onmouseleave',fn) ;
}else{
this.addEventListener('mouseout',function(e){
tar = e.relatedTarget;
if(!contains(this, tar)){
fn .call(this);
}
}, false);
}
return this;
}
}; ').mouseleave(function(){document.getElementById('share_customerdiv').style.display ='none';})
3. The simplest, but it will be slightly different on some systems. Flashing.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn