Created
December 20, 2011 17:20
-
-
Save dcneiner/1502384 to your computer and use it in GitHub Desktop.
Removes the use of layerX and layerY in jQuery 1.4, 1.5, 1.6 (If you can't upgrade to jQuery 1.7 for some reason) - Even referencing these properties throws a warning in Chrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this code snippet after including jQuery | |
// The if statement protects you in case you forget to remove this | |
// once you upgrade to 1.7, or if you try to use it with jQuery 1.3 | |
if (jQuery.event.props[17] === "layerX" ) { | |
jQuery.event.props.splice(17,2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perhaps make this a bit safer with:
(function(p){p[17]==="layerX"&&p.splice(17, 2);})(window.jQuery&&jQuery.event.props||[]);
Still assumes if
jQuery
is defined, it'll have the.event
namespace, but still.