Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

typo.

  • Loading branch information...
commit c31417ade345859006539f0cfdce3fe76f4c8253 1 parent 119b890
authored June 16, 2011
26  takeoverloader/example.js
@@ -3,17 +3,21 @@ $(document).ready( function()
3 3
 	// hide content div (UI being loaded)
4 4
 	$('#content').hide();
5 5
 	// takeover the loading.
6  
-	$(document).takeoverloader( 
7  
-		function( progressAmount ) // called each time an item is loaded
8  
-		{
9  
-			// do something with progressAmout (normalised)
10  
-			$('.loadprogress').text( Math.round( progressAmount * 100 )+'%' );
11  
-		},
12  
-		function() // called when loading is finished
13  
-		{
14  
-			$('.loadprogress').hide();
15  
-			$('#content').fadeIn();
16  
-			// etc
  6
+	$(document).takeoverloader( {
  7
+		progress: function( progressAmount ) // called each time an item is loaded
  8
+			{
  9
+				// do something with progressAmout (normalised)
  10
+				$('.loadprogress').text( Math.round( progressAmount * 100 )+'%' );
  11
+			},
  12
+		complete: function() // called when loading is finished
  13
+			{
  14
+				$('.loadprogress').hide();
  15
+				$('#content').fadeIn();
  16
+				// etc
  17
+			}
17 18
 		}
18 19
 	);
  20
+		
  21
+	// To forcibly remove events, call 'destroy'
  22
+	$(document).takeoverloader( 'destroy' );
19 23
 });
2  takeoverloader/jquery.takeoverloader-0.1.js
@@ -83,7 +83,7 @@
83 83
 		} else if ( typeof method === 'object' || ! method ) {
84 84
 			return methods.init.apply( this, arguments );
85 85
 		} else {
86  
-			$.error( 'Method ' +  method + ' does not exist on jQuery.tooltip' );
  86
+			$.error( 'Method ' +  method + ' does not exist on jQuery.takeoverloader' );
87 87
 		}
88 88
 	}
89 89
 })( jQuery );
2  takeoverloader/jquery.takeoverloader-0.1.min.js
@@ -9,4 +9,4 @@
9 9
  * Date: 2011-06-11
10 10
  */
11 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");
12  
-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);
  12
+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 notes on commit c31417a

Please sign in to comment.
Something went wrong with that request. Please try again.