Mouse Events onmouseout issue event bubbling

Quick JavaScript example to handle the onmouseout event to prevent event bubbling in IE.

if(window.addEventListener)

{

// Mozilla, Netscape, Firefox

object.addEventListener(‘mouseover’,function() {this.className = “objectVisible”;false)

object.addEventListener(‘mouseout’,function() {this.className = “objectNotVisible”;return true;}, false)}

else { // IE

object.onmouseenter = function() {this.className = “objectVisible”;return false;};

object.onmouseleave = function() {this.className = “objectNotVisible”;return false;};

}

You can leave a response, or trackback from your own site.

Leave a Reply

Disclaimer The information expressed in this blog are my own personal opinions.