admin管理员组文章数量:1435859
With jQuery, i'm trying to do
item.css("-o-box-shadow")
or:
item.css("box-shadow")
... but getting empty string.
Under Webkit and Gecko it works, using "-webkit" and "-moz" prefixes.
How to do it under Opera ?
I've also tried "boxShadow", but again, getting empty string.
$(".flag").css("boxShadow", "rgba(0,0,0,0.5) 4pt 4pt 7pt"); // i see, it was set
$(".flag").css("boxShadow"); // returns ""
With jQuery, i'm trying to do
item.css("-o-box-shadow")
or:
item.css("box-shadow")
... but getting empty string.
Under Webkit and Gecko it works, using "-webkit" and "-moz" prefixes.
How to do it under Opera ?
I've also tried "boxShadow", but again, getting empty string.
$(".flag").css("boxShadow", "rgba(0,0,0,0.5) 4pt 4pt 7pt"); // i see, it was set
$(".flag").css("boxShadow"); // returns ""
Share
Improve this question
edited Mar 3, 2011 at 14:27
thirtydot
228k50 gold badges392 silver badges354 bronze badges
asked Mar 3, 2011 at 12:55
AntonALAntonAL
17.5k21 gold badges84 silver badges118 bronze badges
1
-
1
If anybody thinks they've solved this, please provide an example where you retrieve the
box-shadow
property which was set via CSS. – thirtydot Commented Mar 3, 2011 at 14:09
5 Answers
Reset to default 3$('div').css('boxShadow','10px 10px 10px #FF00FF');
so: .css('boxShadow');
After searching and trying for the last fifteen minutes, I think Opera has a bug.
You just can't retrieve the box-shadow
value, unless there's some obscure undocumented way.
this sounds like an issue with the way Opera has implemented boxShadow. i will see what i can dig up about why that value isn't available.
in the meantime, using your example, i think you can retrieve the entire style using $(".flag").attr("style")
then split the string on the ':'.
Seeing as you want to use jQuery you can use this:
$('.item').css('boxShadow','5px 5px 6px #333333');
Example here for you :) (open in Opera)
This is likely a bug in Opera. jQuery's .css() method uses getComputedStyle || currentStyle
to return CSS properties, both of which return the empty string for boxShadow
.
本文标签: javascriptHow to get boxshadow programmatically under OperaStack Overflow
版权声明:本文标题:javascript - How to get box-shadow programmatically under Opera - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745666782a2669333.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论