0
@@ -360,61 +360,47 @@ jQuery.event = {
0
- // Make sure the ready event is setup
0
- teardown: function() { return; }
0
- setup: function( data ) {
0
- if ( jQuery.browser.msie ) return false;
0
- jQuery(this).bind("mouseover", data, jQuery.event.special.mouseenter.handler);
0
- teardown: function() {
0
- if ( jQuery.browser.msie ) return false;
0
- jQuery(this).unbind("mouseover", jQuery.event.special.mouseenter.handler);
0
- handler: function(event) {
0
- // If we actually just moused on to a sub-element, ignore it
0
- if ( withinElement(event, this) ) return true;
0
- // Execute the right handlers by setting the event type to mouseenter
0
- event.type = "mouseenter";
0
- return jQuery.event.handle.apply(this, arguments);
0
- setup: function( data ) {
0
- if ( jQuery.browser.msie ) return false;
0
- jQuery(this).bind("mouseout", data, jQuery.event.special.mouseleave.handler);
0
- teardown: function() {
0
- if ( jQuery.browser.msie ) return false;
0
- jQuery(this).unbind("mouseout", jQuery.event.special.mouseleave.handler);
0
- handler: function(event) {
0
- // If we actually just moused on to a sub-element, ignore it
0
- if ( withinElement(event, this) ) return true;
0
- // Execute the right handlers by setting the event type to mouseleave
0
- event.type = "mouseleave";
0
- return jQuery.event.handle.apply(this, arguments);
0
+ // Make sure the ready event is setup
0
+ teardown: function() {}
0
+if ( !jQuery.browser.msie ){
0
+ // Checks if an event happened on an element within another element
0
+ // Used in jQuery.event.special.mouseenter and mouseleave handlers
0
+ var withinElement = function(event) {
0
+ // Check if mouse(over|out) are still within the same parent element
0
+ var parent = event.relatedTarget;
0
+ // Traverse up the tree
0
+ while ( parent && parent != this )
0
+ try { parent = parent.parentNode; }
0
+ catch(e) { parent = this; }
0
+ // set the correct event type
0
+ event.type = event.data;
0
+ // handle event if we actually just moused on to a non sub-element
0
+ jQuery.event.handle.apply( this, arguments );
0
+ mouseover: 'mouseenter',
0
+ mouseout: 'mouseleave'
0
+ }, function( orig, fix ){
0
+ jQuery.event.special[ fix ] = {
0
+ jQuery.event.add( this, orig, withinElement, fix );
0
+ jQuery.event.remove( this, orig, withinElement );
0
bind: function( type, data, fn ) {
0
return type == "unload" ? this.one(type, data, fn) : this.each(function(){
0
@@ -589,17 +575,6 @@ jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
0
-// Checks if an event happened on an element within another element
0
-// Used in jQuery.event.special.mouseenter and mouseleave handlers
0
-var withinElement = function(event, elem) {
0
- // Check if mouse(over|out) are still within the same parent element
0
- var parent = event.relatedTarget;
0
- // Traverse up the tree
0
- while ( parent && parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; }
0
- // Return true if we actually just moused on to a sub-element
0
- return parent == elem;
0
// Prevent memory leaks in IE
0
// And prevent errors on refresh with events like mouseover in other browsers
0
// Window isn't included so as not to unbind existing unload events
Comments
No one has commented yet.