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?

我想知道解决这个问题最好的方法是什么?

  1. Remove the hidden class on the element
  2. 删除元素上的隐藏类
  3. Change the visibility property
  4. 改变可见性属性
  5. Overwrite the hidden class in my own css
  6. 在我自己的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;
}

更多相关文章

  1. Ajax_04之jQuery中封装的Ajax函数
  2. jQuery -> 获取后代元素的三种方法
  3. JQuery操作<select>元素
  4. jQuery捕获被点击元素的ID
  5. Yii - 加载ajax表单元素的用户端验证
  6. jQuery: 刨根问底 attr and prop两个函数的区别
  7. jQuery ajax问题 - 无法让我的函数工作
  8. 删除后重新插入后保留对元素的引用
  9. 通过调用返回参数的本地函数来构建Ajax Data部分

随机推荐

  1. ANDROID模拟器不能启动
  2. android实现开机欢迎界面
  3. 【学习笔记】android基本环境
  4. android线程调度工具类SchedulerUtils
  5. Andriod(3)——Understanding Android(安
  6. Android实现系统重新启动
  7. Android常用的技术点
  8. Android中设置TextView的颜色setTextColo
  9. Android自动横屏注意事项
  10. Android开发平台部署