/ Published in: JavaScript
Allows for delay functionality in effects, etc.
$("#navpanel").delay(2000).animate({top:"-250px"}, {easing:"swing"});
$("#navpanel").delay(2000).animate({top:"-250px"}, {easing:"swing"});
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$.fn.delay = function( time, name ) { return this.queue( ( name || "fx" ), function() { var self = this; setTimeout(function() { $.dequeue(self); } , time ); } ); };
URL: http://blindsignals.com/index.php/2009/07/jquery-delay/