Delay jQuery animation by few seconds
Related Post:
- jQuery.fx.interval Property
- How to disable jQuery animation
- 8 jQuery Loading Animation and Progress Bar Plugin
To delay execution of animation, use .delay() method which allows to delay the execution of functions that follow it in the queue. It accepts duration as parameter. Durations are given in milliseconds; higher values indicate slower animations, not faster ones.
$(document).ready(function () { $('img').mouseenter(function () { $(this).stop().delay(1000).animate({ height: '+=50px', width: '+=50px' }); }); $('img').mouseleave(function () { $(this).stop().delay(1000).animate({ height: '-=50px', width: '-=50px' }); }); });
Feel free to contact me for any help related to jQuery, I will gladly help you.