admin管理员组文章数量:1414934
I have created a jQuery widget for other people to embed on their website, and within the widget I am using a css reset stylesheet called "cleanslate" from here:
This stops the page style creeping into my widget.
Problem is that my fadeOut and fadeIn's are no longer working because the reset style is overriding the display
inline style jQuery is adding. I need to make the fadeOut function add !important;
to the inline style.
Does anyone know if this is possible?
Thanks in advance.
I have created a jQuery widget for other people to embed on their website, and within the widget I am using a css reset stylesheet called "cleanslate" from here:
https://github./premasagar/cleanslate
This stops the page style creeping into my widget.
Problem is that my fadeOut and fadeIn's are no longer working because the reset style is overriding the display
inline style jQuery is adding. I need to make the fadeOut function add !important;
to the inline style.
Does anyone know if this is possible?
Thanks in advance.
Share Improve this question asked Oct 17, 2013 at 10:42 superphonicsuperphonic 8,0846 gold badges34 silver badges64 bronze badges 6- The !important is pertaining to CSS. You cannot apply it to jQuery. Can you paste your code – MarsOne Commented Oct 17, 2013 at 10:43
- look here: stackoverflow./questions/2655925/… hope that helped. – geevee Commented Oct 17, 2013 at 10:44
-
@MarsOne I want jQuery to add !important to the
display:
style it adds to the element when I use$('#element').fadeOut('slow');
<-- all that does is add display: none, and drop the opacity. I need it to adddisplay: none !important
... – superphonic Commented Oct 17, 2013 at 10:53 - Can you paste your code? – MarsOne Commented Oct 17, 2013 at 10:54
-
I just did...
$('#element').fadeOut('slow');
#element is a <div> – superphonic Commented Oct 17, 2013 at 10:55
1 Answer
Reset to default 7I came up with the solution below, hope it helps someone else in the same situation.
All ments / improvements wele:
jQuery("element").fadeOut("slow", function() {
jQuery("element").attr("style", "display: none !important");
});
Thanks
本文标签: javascriptjQueryMaking fadeOUt use importantStack Overflow
版权声明:本文标题:javascript - jQuery - Making fadeOUt use !important - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745169488a2645885.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论