[ create a new paste ] login | about

Link: http://codepad.org/CUa1ZTmG    [ raw code | fork ]

mike.helgeson - Plain Text, pasted on Jul 2:
mouseenter: {
	setup: function() {
		if ( jQuery.browser.msie ) return false;
		jQuery(this).bind("mouseover", jQuery.event.special.mouseenter.handler);
		return true;
	},

	teardown: function() {
		if ( jQuery.browser.msie ) return false;
		jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler);
		return true;
	},

	handler: function(event) {
		// If we actually just moused on to a sub-element, ignore it
		if ( withinElement(event, this) ) return true;
		// Execute the right handlers by setting the event type to mouseenter
		event.type = "mouseenter";
		return jQuery.event.handle.apply(this, arguments);
	}
},

mouseleave: {
	setup: function() {
		if ( jQuery.browser.msie ) return false;
		jQuery(this).bind("mouseout", jQuery.event.special.mouseleave.handler);
		return true;
	},

	teardown: function() {
		if ( jQuery.browser.msie ) return false;
		jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler);
		return true;
	},

	handler: function(event) {
		// If we actually just moused on to a sub-element, ignore it
		if ( withinElement(event, this) ) return true;
		// Execute the right handlers by setting the event type to mouseleave
		event.type = "mouseleave";
		return jQuery.event.handle.apply(this, arguments);
	}
}


Create a new paste based on this one


Comments: