jQuery - Making fadeOUt use !important
jQuery - Making fadeOUt use !important
我创建了一个jQuery小部件供其他人嵌入他们的网站上,并且在小部件中,我正在使用一个名为"cleanslate"的css重置样式表:
https://github.com/premasagar/cleanslate
这可以阻止页面样式渗入我的小部件。
问题是我的淡出和淡入不再工作,因为重置样式覆盖了 jQuery 添加的display
内联样式。我需要使淡出函数为内联样式添加!important;
。
有谁知道这是否可能?
提前谢谢。
我想
出了下面的解决方案,希望它能帮助处于相同情况的其他人。
欢迎所有评论/改进:
jQuery("element").fadeOut("slow", function() {
jQuery("element").attr("style", "display: none !important");
});
谢谢
相关文章:
- Unit-testing multiple use cases with Karma & Mocha.js
- 仅在Express4上使用app.use('/api')时呈现页面
- Express router.use not working
- Use an external .jpg image in a gallery modal based on CSS &
- 使用 js/jQuery/css 在重力形式中覆盖 !important
- <!文档html>在JS脚本中触发“use strict”
- Javascript str_ replace use“;加“;以及“;减去“;正则表达式中的字符
- Use React and Express
- Use Strict MeteorJS
- Serlvet's request.getParameter and onclick use
- app.use(restify.bodyParser())无法工作,因为req对象为空
- 更新链接形状时,Safari中的SVG clipPath与USE断开
- Use $.get() or this.model.save() (Backbone.js)
- Router.use()需要中间件函数,但得到了一个未定义的函数
- 预加载CSS背景图像[Can't use sprite]
- Javascript : innerHTML.replace use URL
- Ajax and Mongodb, use _id
- Google Map API use LatLng or Address
- Object.Prototype 方法和 IIFE(立即调用的函数表达式)中的“use strict”
- jQuery - Making fadeOUt use !important