Permalink
Browse files

typo.

  • Loading branch information...
1 parent 119b890 commit c31417ade345859006539f0cfdce3fe76f4c8253 pixelbreaker committed Jun 16, 2011
View
26 takeoverloader/example.js
@@ -3,17 +3,21 @@ $(document).ready( function()
// hide content div (UI being loaded)
$('#content').hide();
// takeover the loading.
- $(document).takeoverloader(
- function( progressAmount ) // called each time an item is loaded
- {
- // do something with progressAmout (normalised)
- $('.loadprogress').text( Math.round( progressAmount * 100 )+'%' );
- },
- function() // called when loading is finished
- {
- $('.loadprogress').hide();
- $('#content').fadeIn();
- // etc
+ $(document).takeoverloader( {
+ progress: function( progressAmount ) // called each time an item is loaded
+ {
+ // do something with progressAmout (normalised)
+ $('.loadprogress').text( Math.round( progressAmount * 100 )+'%' );
+ },
+ complete: function() // called when loading is finished
+ {
+ $('.loadprogress').hide();
+ $('#content').fadeIn();
+ // etc
+ }
}
);
+
+ // To forcibly remove events, call 'destroy'
+ $(document).takeoverloader( 'destroy' );
});
View
2 takeoverloader/jquery.takeoverloader-0.1.js
@@ -83,7 +83,7 @@
} else if ( typeof method === 'object' || ! method ) {
return methods.init.apply( this, arguments );
} else {
- $.error( 'Method ' + method + ' does not exist on jQuery.tooltip' );
+ $.error( 'Method ' + method + ' does not exist on jQuery.takeoverloader' );
}
}
})( jQuery );
View
2 takeoverloader/jquery.takeoverloader-0.1.min.js
@@ -9,4 +9,4 @@
* Date: 2011-06-11
*/
(function(e){e.fn.takeoverloader=function(a){var f,b={init:function(a){var c=this.find('img:not([src=""]):not(.noloader)'),b=c.length-1,d=0,h=a.progress||function(){},i=a.complete||function(){},g=function(){d++;h(d/b);d>=b&&(clearInterval(f),c.unbind("load.takeover"),i())};f=setInterval(function(){var a=!0;c.each(function(){if(!this.complete)return a=!1;return!0});a&&(d=total_-1,g())},1E3);c.each(function(){this.complete?g():e(this).bind("load.takeover",function(){g()})});return this},destroy:function(){this.find('img:not([src=""]):not(.noloader)').unbind("load.takeover");
-clearInterval(f)}};if(b[a])return b[a].apply(this,Array.prototype.slice.call(arguments,1));else if(typeof a==="object"||!a)return b.init.apply(this,arguments);else e.error("Method "+a+" does not exist on jQuery.tooltip")}})(jQuery);
+clearInterval(f)}};if(b[a])return b[a].apply(this,Array.prototype.slice.call(arguments,1));else if(typeof a==="object"||!a)return b.init.apply(this,arguments);else e.error("Method "+a+" does not exist on jQuery.takeoverloader")}})(jQuery);

0 comments on commit c31417a

Please sign in to comment.