I'm trying to add a class to an element every 2.5 seconds using delay():
$(".play").click(function(e) {
e.preventDefault();
$('#productimage').addClass('step1');
$('#productimage').delay(2500).addClass('step2');
$('#productimage').delay(5000).addClass('step3');
$('#productimage').delay(7500).addClass('step4');
$('#productimage').delay(10000).addClass('step5');
});
It doesn't seeem to be working because it adds the class step5 straight away. Is this the wrong way to go about it?
Thanks.