While assigning a value for a variable, the variable is taking wrong value. The code is
var txtColor = $(".menu-item").css("background-color");
Where $(".menu-item").css("background-color"); represents pink color. But txtColor is taking as "transparent".
I'm seeing this issue only in IE-8.
Can anyone help me in fixing this issue.
Thanks in advance.
Question, is your CSS set up like this?
background: pink;If so, try using
$('.menu-item').css("background");instead.Old versions of IE will not properly cascade group definitions (like
background) to the other settings. In modern browsers, definingbackgroundas "pink" will also set thebackground-colorto "pink".