I’m using javascript on some parts to modify information on page, and when the information changes, I want to blink the modified information a few times.
I’ve tried this, but it’s not working for some reason.
$('.item_price').css("color" , "red").delay(500).css("color" , "black").delay(500).css("color" , "red").delay(500).css("color" , "black");
delay()is a very weird function; used as you’re using it, it only delays tasks added to thefxqueue (andcss()does not queue to any queue).To force
css()to queue to thefxqueue, use thequeue()function;… etc. Be sure to call the
next()function (passed into the callback) to continue the queue.For more info, I’ve wrote a blog post which explains exactly this, which you may find useful for further reading (as well as the jQuery documentation): http://www.mattlunn.me.uk/blog/2012/06/jquery-delay-not-working-for-you/