Is there a way to delay the addClass()
of jQuery? For example this code
$('#sampleID').delay(2000).fadeOut(500).delay(2000).addClass('aNewClass');
When I load the page, it has the class 'aNewClass' already on id 'sampleID'. How to solve this problem? What I want is the addClass will happen after it ended the fadeOut()
.
delay
. – Painterly