I have the following code:
var oneHeight = Math.ceil(0.012*window.innerHeight).toString()+"px";
var usboxshadow="0px "+oneHeight+" 0px rgba(0,140,255,1), 0px "+oneHeight+" 25px rgba(0,0,0,.7)";
console.log(usboxshadow);
$(".unselected").css("-webkit-box-shadow",usboxshadow);
When I output usboxshadow to the console, I get what I should:
0px 20px 0px rgba(0,140,255,1), 0px 20px 25px rgba(0,0,0,.7)
(the -webkit-box-shadow property)
However, when I retrieve the property with Jquery.css(),
console.log($(".unselected").css("-webkit-box-shadow"));
I get a very different result:
rgb(0, 140, 255) 0px 20px 0px 0px, rgba(0, 0, 0, 0.701961) 0px 20px 25px 0px
First, where did the extra 0px come from in each of the arguments?
Second, why is the rgba alpha(opacity) 0.701961, when it should be 0.7?
Please tell me what I have done wrong.
Edit:
After running the code, the box-shadow of the elements with the class unselected doesn't display.