1 line
1.6 KiB
JSON
1 line
1.6 KiB
JSON
{"name":"outerWidth","type":"method","title":".outerWidth()","deprecated":null,"removed":null,"desc":"Get the current computed width for the first element in the set of matched elements, including padding and border.","categories":["css","dimensions","manipulation/style-properties","version/1.2.6"],"entries":[{"return":"Number","signatures":{"added":"1.2.6","argument":{"desc":"A Boolean indicating whether to include the element's margin in the calculation.","name":"includeMargin","optional":"true","type":"Boolean"}},"examples":{"desc":"Get the outerWidth of a paragraph.","code":"\nvar p = $( \"p:first\" );\n$( \"p:last\" ).text(\n \"outerWidth:\" + p.outerWidth() +\n \" , outerWidth( true ):\" + p.outerWidth( true ) );\n","css":"\n p {\n margin: 10px;\n padding: 5px;\n border: 2px solid #666;\n }\n","html":"\n<p>Hello</p><p></p>\n"},"longdesc":"\n <p>Returns the width of the element, along with left and right padding, border, and optionally margin, in pixels.</p>\n <p>If <code>includeMargin</code> is omitted or <code>false</code>, the padding and border are included in the calculation; if <code>true</code>, the margin is also included.</p>\n <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. Although <code>.outerWidth()</code> can be used on table elements, it may give unexpected results on tables using the <code>border-collapse: collapse</code> CSS property.</p>\n <p class=\"image\">\n <img src=\"/resources/0042_04_06.png\"/>\n </p>\n "}]} |