Permalink
Browse files

fixed ie bugs.

  • Loading branch information...
1 parent 8668e9d commit 282bfc05ff68da356645fea84d4d23bb0b85679e pixelbreaker committed Jun 12, 2011
Showing with 11 additions and 7 deletions.
  1. +9 −5 takeoverloader/jquery.takeoverloader-0.1.js
  2. +2 −2 takeoverloader/jquery.takeoverloader-0.1.min.js
@@ -2,7 +2,7 @@
* jQuery Image Take Over loader v0.1
* http://blog.pixelbreaker.com/javascript/takeover-loader
*
- * Copyright (c) 2011 Gabriel Bucknall
+ * Copyright (c) 2009-2010 Gabriel Bucknall
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@@ -19,7 +19,7 @@
numImages_,
progress_ = progress || function(){},
complete_ = complete || function(){};
-
+
var getAllImages = function()
{
el.find('img:not([src=""]):not(.noloader)').each(function( i, el )
@@ -33,10 +33,14 @@
{
$.each( images_, function( k, v )
{
- $(v.el).load(function()
- {
+ var imgObj = $(v.el);
+ if( v.el.complete )
addLoaded();
- });
+ else
+ $(v.el).load(function()
+ {
+ addLoaded();
+ });
});
};
@@ -2,11 +2,11 @@
* jQuery Image Take Over loader v0.1
* http://blog.pixelbreaker.com/javascript/takeover-loader
*
- * Copyright (c) 2011 Gabriel Bucknall
+ * Copyright (c) 2009-2010 Gabriel Bucknall
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Date: 2011-06-11
*/
-(function(b){b.fn.takeoverloader=function(e,f){var g=this,c=[],a,h=e||function(){},i=f||function(){};(function(){g.find('img:not([src=""]):not(.noloader)').each(function(a,d){c.push({uri:b(d).attr("src"),el:d})});a=c.length})();(function(){b.each(c,function(e,d){b(d.el).load(function(){a--;h(1-a/c.length);a==0&&i()})})})()}})(jQuery);
+(function(c){c.fn.takeoverloader=function(f,g){var h=this,d=[],a,i=f||function(){},j=g||function(){},e=function(){a--;i(1-a/d.length);a==0&&j()};(function(){h.find('img:not([src=""]):not(.noloader)').each(function(a,b){d.push({uri:c(b).attr("src"),el:b})});a=d.length})();(function(){c.each(d,function(a,b){c(b.el);b.el.complete?e():c(b.el).load(function(){e()})})})()}})(jQuery);

0 comments on commit 282bfc0

Please sign in to comment.