Skip to content

Commit 9d78f2d

Browse files
committed
innerHeight(): Add documentation for innerHeight as setter
1 parent 536292c commit 9d78f2d

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

entries/innerHeight.xml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?xml version="1.0"?>
2+
<entries>
3+
<desc>Get the current computed inner height (including padding but not border) for the first element in the set of matched elements or set the inner height of every matched element.</desc>
4+
25
<entry type="method" name="innerHeight" return="Number">
36
<title>.innerHeight()</title>
47
<signature>
@@ -36,3 +39,69 @@ $( "p:last" ).text( "innerHeight:" + p.innerHeight() );
3639
<category slug="manipulation/style-properties"/>
3740
<category slug="version/1.2.6"/>
3841
</entry>
42+
43+
<entry type="method" name="innerHeight" return="jQuery">
44+
<signature>
45+
<added>1.8.0</added>
46+
<argument name="value">
47+
<type name="String"/>
48+
<type name="Number"/>
49+
<desc>A number representing the number of pixels, or a number along with an optional unit of measure appended (as a string).</desc>
50+
</argument>
51+
</signature>
52+
<signature>
53+
<added>1.8.0</added>
54+
<argument name="function" type="Function">
55+
<argument name="index" type="Integer" />
56+
<argument name="width" type="Number" />
57+
<return>
58+
<type name="String"/>
59+
<type name="Number"/>
60+
</return>
61+
<desc>A function returning the inner height (including padding but not border) to set. Receives the index position of the element in the set and the old inner height as arguments. Within the function, <code>this</code> refers to the current element in the set.</desc>
62+
</argument>
63+
</signature>
64+
<desc>Set the CSS inner height of each element in the set of matched elements.</desc>
65+
<longdesc>
66+
<p>When calling <code>.innerHeight("value")</code>, the value can be either a string (number and unit) or a number. If only a number is provided for the value, jQuery assumes a pixel unit. If a string is provided, however, any valid CSS measurement may be used for the height (such as <code>100px</code>, <code>50%</code>, or <code>auto</code>). Note that in modern browsers, the CSS height property does not include padding, border, or margin, unless the <code>box-sizing</code> CSS property is used.</p>
67+
<p>If no explicit unit is specified (like "em" or "%") then "px" is assumed.</p>
68+
</longdesc>
69+
<example>
70+
<desc>Change the inner height of each div the first time it is clicked (and change its color).</desc>
71+
<code><![CDATA[
72+
var modHeight = 70;
73+
$( "div" ).one( "click", function() {
74+
$( this ).innerHeight( modHeight ).addClass( "mod" );
75+
modHeight -= 8;
76+
});
77+
]]></code>
78+
<css><![CDATA[
79+
div {
80+
width: 60px;
81+
padding: 10px;
82+
height: 70px;
83+
float: left;
84+
margin: 5px;
85+
background: red;
86+
cursor: pointer;
87+
}
88+
.mod {
89+
background: blue;
90+
cursor: default;
91+
}
92+
]]></css>
93+
<html><![CDATA[
94+
<div>d</div>
95+
<div>d</div>
96+
<div>d</div>
97+
<div>d</div>
98+
<div>d</div>
99+
]]></html>
100+
</example>
101+
<category slug="css"/>
102+
<category slug="dimensions"/>
103+
<category slug="manipulation/style-properties"/>
104+
<category slug="version/1.8"/>
105+
</entry>
106+
107+
</entries>

0 commit comments

Comments
 (0)