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)
(property -webkit-box-shadow)
However, when I return the property using jquery.css (),
console.log($(".unselected").css("-webkit-box-shadow"));
I get a completely 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 in each of the arguments come from?
Secondly, why rgba alpha (opacity) 0.701961, when should it be 0.7?
Please tell me what I did wrong.
Edit :
After running the code, the shadow of a block of elements with an unselected class is not displayed.