I need to integrate this function into my wordpress and I also need to use multiple events of example and it only works with one. Any advice? Thanks.
<div id="example">
<p style="display: block;">3 Hours</p>
<p>2h and 30m</p>
<p>2h</p>
<p>1h and 30m</p>
<p>1h</p>
<p>30min</p>
<p>Started</p>
</div>
Jquery
$(document).ready(function(){
$("#example p:first").css("display", "block");
jQuery.fn.timer = function() {
if(!$(this).children("p:last-child").is(":visible")){
$(this).children("p:visible")
.css("display", "none")
.next("p").css("display", "block");
}
else{
$(this).children("p:visible")
.css("display", "none")
.end().children("p:first")
.css("display", "block");
}
} // timer function end
window.setInterval(function() {
$("#example").timer();
}, 50);
});
add this to your functions.php