A Tale of Backgrounds, Absolutes, mouseleave, and mouseenter
Posted by: K. Scott Allen,
on 18 Aug 2011 |
View original | Bookmarked: 0 time(s)
mouseleave is simple to understand: Bind an event handler to be fired when the mouse leaves an element, or trigger that handler on an element. How hard could it be? http://jsfiddle.net/JP6aV/ $(function () {
var output = $("#output");
$("#content")
.mouseenter(function (e) {
output.text("I'm in!");
}).mouseout(function (e) {
output.text("I'm out!");
});
});
Like many simple things there are some traps under different circumstances. For example, when...