mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-19 07:20:24 +00:00
73 lines
No EOL
2.7 KiB
HTML
73 lines
No EOL
2.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang='en'><head><meta http-equiv='content-type' content='text/html; charset=UTF-8' /></head><body>
|
|
<div class="ui-page">
|
|
<div class="ui-header">
|
|
<h1>:hidden Selector</h1>
|
|
|
|
</div>
|
|
<div class="entry selector" id="hidden1">
|
|
<h2 class="jq-clearfix roundTop section-title">
|
|
<span class="name">hidden</span> selector</h2>
|
|
<div class=" entry-details">
|
|
<h4 class="name">
|
|
<span class="versionAdded">version added: <a href="/version/1.0/">1.0</a></span>jQuery(':hidden')</h4>
|
|
<p class="desc"><strong>Description: </strong>Selects all elements that are hidden.</p>
|
|
<div class="longdesc">
|
|
<p>Elements can be considered hidden for several reasons:</p>
|
|
<ul>
|
|
<li>They have a display value of none.</li>
|
|
<li>They are form elements with type="hidden".</li>
|
|
<li>Their width and height are explicitly set to 0.</li>
|
|
<li>An ancestor element is hidden, so the element is not shown on the page.</li>
|
|
</ul>
|
|
<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://docs.jquery.com/Release:jQuery_1.3.2#:visible.2F:hidden_Overhauled">release notes</a> outline the changes in more detail.</p>
|
|
</div>
|
|
<h3>Example:</h3>
|
|
<div id="entry-examples" class="entry-examples"><div id="example-0">
|
|
<h4><span class="desc">Shows all hidden divs and counts hidden inputs.</span></h4>
|
|
<pre><code class="example demo-code"><!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
div { width:70px; height:40px; background:#ee77ff; margin:5px; float:left; }
|
|
span { display:block; clear:left; color:red; }
|
|
.starthidden { display:none; }
|
|
</style>
|
|
<script src="http://code.jquery.com/jquery-latest.js"></script>
|
|
</head>
|
|
<body>
|
|
<span></span>
|
|
<div></div>
|
|
<div style="display:none;">Hider!</div>
|
|
<div></div>
|
|
|
|
<div class="starthidden">Hider!</div>
|
|
<div></div>
|
|
<form>
|
|
<input type="hidden" />
|
|
|
|
<input type="hidden" />
|
|
<input type="hidden" />
|
|
</form>
|
|
<span>
|
|
|
|
</span>
|
|
<script>
|
|
// in some browsers :hidden includes head, title, script, etc... so limit to body
|
|
$("span:first").text("Found " + $(":hidden", document.body).length +
|
|
" hidden elements total.");
|
|
$("div:hidden").show(3000);
|
|
$("span:last").text("Found " + $("input:hidden").length + " hidden inputs.");
|
|
|
|
</script>
|
|
</body>
|
|
</html></code></pre>
|
|
<h4>Demo:</h4>
|
|
<div class="demo code-demo"></div>
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</body></html> |