Reputation: 1034
I've got a function:
(function(jQuery) {
jQuery.fn.przelicz = function() {
return this.each(function() {
var wysokosc = jQuery(window).height() * 0.554;
jQuery(this).find("img").height(wysokosc);
jQuery(this).height(wysokosc);
});
};
})(jQuery);
I wish that this function will be run with 300ms delay. How to do this?
Upvotes: 0
Views: 158
Reputation: 4188
An alternative using jquery api can be found here http://api.jquery.com/delay/
Upvotes: 1
Reputation: 781235
You can use the standard JavaScript setTimeout()
function to run a function after a delay.
setTimeout(jQuery.fn.przelicz, 300);
Upvotes: 1