jquery-mobile/experiments/api-viewer/docs/innerWidth/index.html
2010-11-01 21:46:29 -04:00

45 lines
No EOL
2 KiB
HTML

<!DOCTYPE html>
<html lang='en'><head>
<meta charset="utf-8" /><meta http-equiv='content-type' content='text/html; charset=UTF-8' /></head><body>
<div data-role="page">
<div data-role="header">
<h1>.innerWidth()</h1>
</div>
<div data-role="content" data-theme="c" id="innerWidth1">
<h2 class="jq-clearfix roundTop section-title">
<span class="name">.innerWidth()</span> <span class="returns">Returns: <a class="return" href="http://docs.jquery.com/Types#Integer">Integer</a></span>
</h2>
<div class=" entry-details">
<p class="desc"><strong>Description: </strong>Get the current computed width for the first element in the set of matched elements, including padding but not border.</p>
<ul class="signatures"><li class="signature" id="innerWidth"><h4 class="name">
<span class="versionAdded">version added: <a href="/category/version/1.2.6/">1.2.6</a></span>.innerWidth()</h4></li></ul>
<div class="longdesc">
<p>This method returns the width of the element, including left and right padding, in pixels.</p>
<p>This method is not applicable to <code>window</code> and <code>document</code> objects; for these, use <code><a href="/width">.width()</a></code> instead.</p>
<p class="image"><img src="http://api.jquery.com/images/0042_04_05.png"></p>
</div>
<h3>Example:</h3>
<div id="entry-examples" class="entry-examples"><div id="example-0">
<h4><span class="desc">Get the innerWidth of a paragraph.</span></h4>
<pre><code class="example demo-code">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;style&gt;p { margin:10px;padding:5px;border:2px solid #666; } &lt;/style&gt;
&lt;script src="http://code.jquery.com/jquery-latest.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;&lt;/p&gt;
&lt;script&gt;var p = $("p:first");
$("p:last").text( "innerWidth:" + p.innerWidth() );&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>