AJAX: Bring attention to an updated element
February 9th, 2014Sometimes when you’ve updated existing content on the users screen via AJAX you might want the updated part
flash or highlight in some way to illustrate what part of the page was just updated.
There might be other reasons to bring attention to a certain area of a page too, possibly a missing value, notification etc.
Here’s a simple one-line extension plugin for jQuery which flashes the targeted block element.
1 2 3 | $.fn.attention = function () { this.fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300).fadeOut(300).fadeIn(300); } |
Here’s a demo of the above, including some other experiments (which are not cut’n’paste ready – just meant to spawn ideas )