1 line
1.9 KiB
JSON
1 line
1.9 KiB
JSON
{"name":"visible","type":"selector","title":":visible Selector","deprecated":null,"removed":null,"desc":"Selects all elements that are visible.","categories":["selectors/jquery-selector-extensions","version/1.0","selectors/visibility-filter-selectors"],"entries":[{"return":"","signatures":{"added":"1.0"},"examples":{"desc":"Make all visible divs turn yellow on click.","code":"\n$( \"div:visible\" ).click(function() {\n $( this ).css( \"background\", \"yellow\" );\n});\n$( \"button\" ).click(function() {\n $( \"div:hidden\" ).show( \"fast\" );\n});\n","css":"\n div {\n width: 50px;\n height: 40px;\n margin: 5px;\n border: 3px outset green;\n float: left;\n }\n .starthidden {\n display: none;\n }\n","html":"\n<button>Show hidden to see they don't change</button>\n<div></div>\n<div class=\"starthidden\"></div>\n<div></div>\n<div></div>\n<div style=\"display:none;\"></div>\n"},"longdesc":"\n <p>Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero.</p>\n <p>Elements with <code>visibility: hidden</code> or <code>opacity: 0</code> are considered visible, since they still consume space in the layout.</p>\n <p>Elements that are not in a document are considered to be hidden; jQuery does not have a way to know if they will be visible when appended to a document since it depends on the applicable styles.</p>\n <p>During animations that hide an element, the element is considered to be visible until the end of the animation. During animations to show an element, the element is considered to be visible at the start at the animation.</p>\n <p>How <code>:visible</code> is calculated was changed in jQuery 1.3.2. The <a href=\"http://blog.jquery.com/2009/02/20/jquery-1-3-2-released/#visible-hidden-overhauled\">release notes</a> outline the changes in more detail.</p>\n "}],"slug":"visible-selector"} |