This is my jQuery function:
var flashField = function ($field) {
var colour = $field.css('background-color'); // gets colour ok
$field.css( 'backgroundColor', '#FF0000' ); // sets background ok
$field.animate({ 'backgroundColor': colour }, 1500); // nada
}
I want to grab the element's current background, switch it to red and then fade back to the original colour.
However the animate
function doesn't do anything and no errors are shown in the console.
What have I done wrong? Have tried searching but can't find anything that shows bad syntax or whatever.
(testing in Chrome 45.0.2454.93 m)