In the previous post I wrote about Timed Event jQuery plugin. Here is documentation for it.
Usage
In order to use Timed Event, you must follow these steps:
- Download plugin arhcive and unpack it.
- Include jQuery and plugin file (jquery.timed-event.js or jquery.timed-event-min.js) to your web page.
-
Now you can use Timed Event in your code. Use it in this way:
As you can see,$("selector").timedBind("event-type", {delay: [time of delay in milliseconds], buffer: [time of buffer in milliseconds]}, function() { //event handler function });timedBindaccepts the same parameters as jQuery nativebindfunction. But you should take into account that thedataparameter inbindfunction is optional, but is required intimedBindfunction (in other words, all three parameters oftimedBindare required). You can pass an empty object asdataparameter, but in this case the behaviour of thetimedBindwill not differ frombindmethod. Both properties ofdataobject(delayandbuffer) are optional, you can pass any combination of them.
Contribution
If you have some suggestions on improvement the plugin, feel free to email me at Kadalashvili at Vladimir at gmail dot com.
4 comments:
Nice work. Thanks.
How would the code be, if I'd like to show an animation 3sec after the page is loaded?
Got it!
$(window).timedBind("load", {delay: 3000}, function(){
$('#element_to_move').animate({
'top': '30px',
'left': '1020px'
}, 500);
});
for line:
return function(e) {fn.call(e.target, e);};
IE7 says "target is null or not an object"
In my copy as well as on your demo page
Thanks for the plugin. It works fine in Firefox and Safari, but not in IE7. I'm not sure why as I don't get any error messages, it simply doesn't do anything. This applies to the demo page as well, so I don't think it's something in my code. Any ideas?
Post a Comment