I need to blink between two colors:red and white.
I've found that after $targetcss('background-color','red')
,
value of $targetcss('background-color')
is not red,but rgb(255, 255, 255)
,
pay attention that there is a space between "," and digit in firefox,
but there is no space in IE.
And my code is now :
if(existingBgColor != 'rgb(255, 255, 255)')
$target.css('background-color', 'rgb(255, 255, 255)');
else
$target.css('background-color', 'white');
Which works in firefox,but no for IE.
Of course I can change it to this to make it apply for IE:
if(existingBgColor != 'rgb(255, 255, 255)' && existingBgColor != 'rgb(255,255,255)')
$target.css('background-color', 'rgb(255, 255, 255)');
else
$target.css('background-color', 'white');
But what for a third browser?
Is there a standard solution for this?