X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=src%2Fevent.js;h=014fb7362e111ea6bef95b5ed5364b9ecdd19b55;hb=3a23a5c17dd0522da06db8f36890f134f9004de6;hp=7cfb535b6f1d8a5242303bc78ec8f97001be9eeb;hpb=262fcf7b7b919da1564509f621cf7480a5d5572b;p=jquery.git diff --git a/src/event.js b/src/event.js index 7cfb535..014fb73 100644 --- a/src/event.js +++ b/src/event.js @@ -693,13 +693,14 @@ jQuery.fn.extend({ return this.click( jQuery.event.proxy( fn, function( event ) { // Figure out which function to execute - this.lastToggle = ( this.lastToggle || 0 ) % i; + var lastToggle = ( jQuery.data( this, 'lastToggle' + fn.guid ) || 0 ) % i; + jQuery.data( this, 'lastToggle' + fn.guid, lastToggle + 1 ); // Make sure that clicks stop event.preventDefault(); // and execute the function - return args[ this.lastToggle++ ].apply( this, arguments ) || false; + return args[ lastToggle ].apply( this, arguments ) || false; })); }, @@ -848,10 +849,15 @@ function bindReady() { } }); - // If IE and not an iframe + // If IE and not a frame // continually check to see if the document is ready - // NOTE: DO NOT CHANGE TO ===, FAILS IN IE. - if ( document.documentElement.doScroll && window == window.top ) (function() { + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e){} + + if ( document.documentElement.doScroll && toplevel ) (function() { if ( jQuery.isReady ) { return; }