jquery-mobile/experiments/api-viewer/docs/hidden-selector/index.html
scottjehl f9f236fb8b Big update:
In starting markup, pages should now be identified with the attribute data-role="page".  This allows us to then add ui-page programatically, hiding all non-active pages, and apply ui-page-active to one page at a time to show it.

mobile.js is updated to find pages by this attribute now, instead of ui-page class.

fixes issue 32
2010-09-18 12:20:35 -04:00

73 lines
No EOL
2.8 KiB
HTML

<!DOCTYPE html>
<html lang='en'><head><meta http-equiv='content-type' content='text/html; charset=UTF-8' /></head><body>
<div data-role="page">
<div class="ui-header">
<h1>:hidden Selector</h1>
</div>
<div class="ui-content ui-body ui-body-c" 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">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;style&gt;
div { width:70px; height:40px; background:#ee77ff; margin:5px; float:left; }
span { display:block; clear:left; color:red; }
.starthidden { display:none; }
&lt;/style&gt;
&lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;span&gt;&lt;/span&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div style="display:none;"&gt;Hider!&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div class="starthidden"&gt;Hider!&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;form&gt;
&lt;input type="hidden" /&gt;
&lt;input type="hidden" /&gt;
&lt;input type="hidden" /&gt;
&lt;/form&gt;
&lt;span&gt;
&lt;/span&gt;
&lt;script&gt;
// 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.");
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<h4>Demo:</h4>
<div class="demo code-demo"></div>
</div></div>
</div>
</div>
</div>
</body></html>