How can I toggle the class for just 1 second, every 5 seconds?
This is the action I would like, just need to make it happen for 1 second, every 5 seconds..
$('#donate').toggleClass('wiggle');
Use the following
setInterval(function(){
// toggle the class every five second
$('#donate').toggleClass('wiggle');
setTimeout(function(){
// toggle back after 1 second
$('#donate').toggleClass('wiggle');
},1000);
},5000);
DEMO http://jsfiddle.net/joycse06/vqRqf/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With