jQuery show()用于隐藏Twitter引导css类
I'm using Twitter Bootstrap and I notice that jQuery show()
or fadeIn()
doesn't make DOM element marked with class hidden
appear because the jQuery functions only remove the display: none
specification. However, the visibility
is still set to hidden
.
我正在使用Twitter Bootstrap,我注意到jQuery show()或fadeIn()没有让标记为隐藏类的DOM元素出现,因为jQuery函数只删除显示:none规范。但是,可见性仍然设置为隐藏。
I wonder what is the best possible way to work around this?
我想知道解决这个问题最好的方法是什么?
- Remove the
hidden
class on the element - 删除元素上的隐藏类
- Change the visibility property
- 改变可见性属性
- Overwrite the hidden class in my own css
- 在我自己的css中覆盖隐藏的类
In particular, I want to know whether fixing this with jQuery or css is better and why.
特别是,我想知道用jQuery还是css修复这个问题更好,为什么。
6 个解决方案
#1
111
The css class you're looking for is .collapse
. This sets the element to display: none;
您要查找的css类是.collapse。这将设置要显示的元素:none;
So using $('#myelement').show()
will work properly.
因此,使用$('#myelement').show()将正常工作。
UPDATE : Bootstrap v3.3.6 has updated .collapse back to:
更新:Bootstrap v3.3.6已经更新。
.collapse {
display: none;
}
更多相关文章
- Ajax_04之jQuery中封装的Ajax函数
- jQuery -> 获取后代元素的三种方法
- JQuery操作<select>元素
- jQuery捕获被点击元素的ID
- Yii - 加载ajax表单元素的用户端验证
- jQuery: 刨根问底 attr and prop两个函数的区别
- jQuery ajax问题 - 无法让我的函数工作
- 删除后重新插入后保留对元素的引用
- 通过调用返回参数的本地函数来构建Ajax Data部分