Permalink
Browse files

Merge pull request #2 from studio31design/master

Fixed Double-firing in IE9
  • Loading branch information...
2 parents 441cf14 + 84b32ef commit 7b61e3368c629a5efb6758f2849b51ba1efab0da @kof committed Nov 23, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/jquery.xLazyLoader.js
@@ -148,9 +148,12 @@ function xLazyLoader ()
var link = $('<link rel="stylesheet" type="text/css" media="all" href="'+ href + key + '" id="'+name+'"></link>')[0];
if ( $.browser.msie ) {
- link.onreadystatechange = function () {
- /loaded|complete/.test(link.readyState) && callback();
- };
+ link.onreadystatechange = function (){
+ if (link.readyState == "loaded" || link.readyState == "complete") {
+ link.onreadystatechange = null;
+ callback();
+ }
+ }
} else if ( $.browser.opera ) {
link.onload = callback;
} else {

0 comments on commit 7b61e33

Please sign in to comment.