Using jquery animation to highlight div on load

I have a simple notification system. I want to use jquery to highlight the onload div by changing the background color and returning to normal after 500ms only flash. Similar to when we answer questions about Stackoverflow. Simple enough to get attention.

<div id="flash">Notification</div> 

 $(function() {
    $( "#flash" ).animate({
    backgroundColor: "#aa0000",
     }, 1000 );
 });

It does not work as expected. It does not switch to #ffffff.

I appreciate any help.

+3
source share
1 answer

jQuery UI has a specific effect for this called highlight . Use considerations animatefor type properties are background-colordescribed here :

, ; , numeric , jQuery. ( , , , be.) , . em % .

, jQuery UI, , background-color .

example: http://jsfiddle.net/niklasvh/x2jrU/

+5

All Articles