control-freak-ide/Control-Freak-Documentation/jQuery/docs/entries/hidden-selector.json
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

1 line
2.7 KiB
JSON

{"name":"hidden","type":"selector","title":":hidden Selector","deprecated":null,"removed":null,"desc":"Selects all elements that are hidden.","categories":["selectors/jquery-selector-extensions","version/1.0","selectors/visibility-filter-selectors"],"entries":[{"return":"","signatures":{"added":"1.0"},"examples":{"desc":"Shows all hidden divs and counts hidden inputs.","code":"\n// In some browsers :hidden includes head, title, script, etc...\nvar hiddenElements = $( \"body\" ).find( \":hidden\" ).not( \"script\" );\n\n$( \"span:first\" ).text( \"Found \" + hiddenElements.length + \" hidden elements total.\" );\n$( \"div:hidden\" ).show( 3000 );\n$( \"span:last\" ).text( \"Found \" + $( \"input:hidden\" ).length + \" hidden inputs.\" );\n","css":"\n div {\n width: 70px;\n height: 40px;\n background: #e7f;\n margin: 5px;\n float: left;\n }\n span {\n display: block;\n clear: left;\n color: red;\n }\n .starthidden {\n display: none;\n }\n","html":"\n<span></span>\n<div></div>\n<div style=\"display:none;\">Hider!</div>\n<div></div>\n\n<div class=\"starthidden\">Hider!</div>\n<div></div>\n\n<form>\n <input type=\"hidden\">\n <input type=\"hidden\">\n <input type=\"hidden\">\n</form>\n\n<span></span>\n"},"longdesc":"\n <p>Elements can be considered hidden for several reasons:</p>\n <ul>\n <li>They have a CSS <code>display</code> value of <code>none</code>.</li>\n <li>They are form elements with <code>type=\"hidden\"</code>.</li>\n <li>Their width and height are explicitly set to 0.</li>\n <li>An ancestor element is hidden, so the element is not shown on the page.</li>\n </ul>\n <p>Elements with <code>visibility: hidden</code> or <code>opacity: 0</code> are considered to be visible, since they still consume space in the layout. During animations that hide an element, the element is considered to be visible until the end of the animation.</p>\n <p>Elements that are not in a document are not considered to be visible; 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 to show an element, the element is considered to be visible at the start of the animation.</p>\n <p>How <code>:hidden</code> is determined was changed in jQuery 1.3.2. An element is assumed to be hidden if it or any of its parents consumes no space in the document. CSS visibility isn't taken into account (therefore <code>$( elem ).css( \"visibility\", \"hidden\" ).is( \":hidden\" ) == false</code>). 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":"hidden-selector"}