Home > Web Front-end > JS Tutorial > body text

javascript onmouseout solution_javascript skills

WBOY
Release: 2016-05-16 18:23:05
Original
1078 people have browsed it

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.

Copy code The code is as follows:


 

  faddsf 


2.
Copy code The code is as follows:

 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.


More from this person...
Message Board
Friends



Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!