jQuery可见性过滤器:hidden和:visibility用法实例_jquery

WBOY
Release: 2016-05-16 15:52:55
Original
1706 people have browsed it

本文实例讲述了jQuery可见性过滤器:hidden和:visibility用法。分享给大家供大家参考。具体分析如下:

:hidden
匹配所有不可见元素,如果使用css的visibility属性让元素不显示但是占位,则不属于hidden了
查找display:none的tr元素,$("tr:hidden")

:visible
匹配所有可见元素
查找所有display不为none的元素,$("tr:visible")

例子:

12 34 56 $("tr:hidden");//选中id为one的元素 $("tr:visible");//选中id为"two"和"three"的元素
Copy after login

其实,这里两个过滤器并不在乎元素到底是不是隐藏不可见的,我觉得只要是display:none则用:hidden可以将其获取,如果没有display:none,不管是什么都可以获取。

希望本文所述对大家的jQuery程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!