for some reason, this isn't adding and removing a new class on elements with the class of post, every 4 seconds. jquery loads correctly, as does this. chrome shows no errors with the code.
$(document).ready(function(){
$('.post').addClass('display').delay(4000).removeClass('display');
});
Since you listed you want this to happen every 4 seconds you can simply use setInterval()
var $post = $(".post");
setInterval(function(){
$post.toggleClass("display");
}, 4000);
Note, the selector is cached in $post
to minimize the number of times the DOM needs queried on each interval.
Example on jsfiddle
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