element.offsetWidth

  • Ciąg znaków tej wersji: DOM/element.offsetWidth
  • Tytuł wersji: element.offsetWidth
  • Identyfikator wersji: 5750
  • Utworzono:
  • Autor: Internauta1024A
  • Czy jest aktualna? Nie
  • Komentarz

Zawartość wersji

{{template.DomRef()}} {{template.Dopracuj()}}

offsetWidth

{{template.Abbr("DHTML", "Dynamic HyperText Markup Language")}} property that gets the width of an element relative to the layout.

Składnia i wartości

var intElemOffsetWidth = document.getElementById(id_attribute_value).offsetWidth;

intElemOffsetWidth is a variable storing an integer corresponding to the offsetWidth pixel value of the element. offsetWidth is a read-only property.

Opis

Typically, an element's offsetWidth is a measurement which includes the element borders, the element horizontal padding, the element vertical scrollbar (if present, if rendered) and the element CSS width.

Przykład

padding-top

Gentle, individualistic and very loyal, Birman cats fall between Siamese and Persian in character. If you admire cats that are non aggressive, that enjoy being with humans and tend to be on the quiet side, you may well find that Birman cats are just the felines for you.

Image:BirmanCat.jpgAll Birmans have colorpointed features, dark coloration of the face, ears, legs and tail.

Cat image and text coming from www.best-cat-art.com

padding-bottom

LeftTopRightBottommargin-topmargin-bottomborder-topborder-bottom{{mediawiki.external('if IE')}}><span id="MrgLeft" style="position: absolute; left: 8px; top: 65px; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;">margin-left</span><span id="BrdLeft" style="position: absolute; left: 33px; top: 65px; color: white; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;">border-left</span><span id="PdgLeft" style="position: absolute; left: 55px; top: 65px; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;">padding-left</span><span id="PdgRight" style="position: absolute; left: 275px; top: 60px; color: black; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl; white-space: nowrap;">padding-right</span><span id="BrdRight" style="position: absolute; left: 310px; top: 65px; color: white; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;">border-right</span><span id="MrgRight" style="position: absolute; left: 340px; top: 65px; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;">margin-right</span><!{{mediawiki.external('endif')}}

Image:offsetWidth.png

Specification

offsetWidth is part of the MSIE's {{template.Abbr("DHTML", "Dynamic HyperText Markup Language")}} object model. offsetWidth is not part of any W3C specification or technical recommendation.

Notes

offsetWidth is a property of the {{template.Abbr("DHTML", "Dynamic HyperText Markup Language")}} object model which was first introduced by MSIE. It is sometimes referred as an element physical/graphical dimensions or an element's box width.

References

{{ wiki.languages( { "en": "en/DOM/element.offsetWidth" } ) }}

Źródło wersji

<p>
{{template.DomRef()}}
{{template.Dopracuj()}}
</p>
<h3 name="offsetWidth">offsetWidth</h3>
<p>{{template.Abbr("DHTML", "Dynamic HyperText Markup Language")}} property that gets the width of an element relative to the layout.
</p>
<h3 name="Sk.C5.82adnia_i_warto.C5.9Bci">Składnia i wartości</h3>
<pre class="eval">var <i>intElemOffsetWidth</i> = document.getElementById(<i>id_attribute_value</i>).offsetWidth;
</pre>
<p><i>intElemOffsetWidth</i> is a variable storing an integer corresponding to the offsetWidth pixel value of the element.
offsetWidth is a read-only property.
</p>
<h3 name="Opis">Opis</h3>
<p>Typically, an element's <b>offsetWidth</b> is a measurement which includes the element borders, the element horizontal padding, the element vertical scrollbar (if present, if rendered) and the element CSS width.
</p>
<h3 name="Przyk.C5.82ad">Przykład</h3>
<div id="offsetContainer" style="margin: 26px 0px; background-color: rgb(255, 255, 204); border: 4px dashed black; color: black; position: absolute; left: 260px;"><div id="idDiv" style="margin: 24px 29px; border: 24px black solid; padding: 0px 28px; width: 199px; height: 102px; overflow: auto; background-color: white; font-size: 13px!important; font-family: Arial, sans-serif;"><p id="PaddingTopLabel" style="text-align: center; font-style: italic; font-weight: bold; font-size: 13px!important; font-family: Arial, sans-serif; margin: 0px;">padding-top</p>
<p>Gentle, individualistic and very loyal, Birman cats fall between Siamese and Persian in character. If you admire cats that are non aggressive, that enjoy being with humans and tend to be on the quiet side, you may well find that Birman cats are just the felines for you.</p>
<p><span style="float: right;"><img alt="Image:BirmanCat.jpg" src="File:pl/Media_Gallery/BirmanCat.jpg"></span>All Birmans have colorpointed features, dark coloration of the face, ears, legs and tail.</p>
<p>Cat image and text coming from <a class="external" href="http://www.best-cat-art.com/">www.best-cat-art.com</a></p>
<p id="PaddingBottomLabel" style="text-align: center; font-style: italic; font-weight: bold; font-size: 13px!important; font-family: Arial, sans-serif; margin: 0px;">padding-bottom</p></div><span style="position: absolute; left: -32px; top: 85px; color: blue; font-weight: bold; font-size: 13px!important; font-family: Arial, sans-serif;">Left</span><span style="position: absolute; left: 170px; top: -24px; color: blue; font-weight: bold; font-size: 13px!important; font-family: Arial, sans-serif;">Top</span><span style="position: absolute; left: 370px; top: 85px; color: blue; font-weight: bold; font-size: 13px!important; font-family: Arial, sans-serif;">Right</span><span style="position: absolute; left: 164px; top: 203px; color: blue; font-weight: bold; font-size: 13px!important; font-family: Arial, sans-serif;">Bottom</span><span style="position: absolute; left: 143px; top: 5px; font-style: italic; font-weight: bold; font-size: 13px!important; font-family: Arial, sans-serif;">margin-top</span><span style="position: absolute; left: 138px; top: 175px; font-style: italic; font-weight: bold; font-size: 13px!important; font-family: Arial, sans-serif;">margin-bottom</span><span style="position: absolute; left: 143px; top: 27px; color: white; font-style: italic; font-weight: bold; font-size: 13px!important; font-family: Arial, sans-serif;">border-top</span><span style="position: absolute; left: 138px; top: 153px; color: white; font-style: italic; font-weight: bold; font-size: 13px!important; font-family: Arial, sans-serif;">border-bottom</span><span class="comment">{{mediawiki.external('if IE')}}&gt;&lt;span id="MrgLeft" style="position: absolute; left: 8px; top: 65px; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;"&gt;margin-left&lt;/span&gt;&lt;span id="BrdLeft" style="position: absolute; left: 33px; top: 65px; color: white; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;"&gt;border-left&lt;/span&gt;&lt;span id="PdgLeft" style="position: absolute; left: 55px; top: 65px; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;"&gt;padding-left&lt;/span&gt;&lt;span id="PdgRight" style="position: absolute; left: 275px; top: 60px; color: black; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl; white-space: nowrap;"&gt;padding-right&lt;/span&gt;&lt;span id="BrdRight" style="position: absolute; left: 310px; top: 65px; color: white; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;"&gt;border-right&lt;/span&gt;&lt;span id="MrgRight" style="position: absolute; left: 340px; top: 65px; font: bold 13px Arial, sans-serif !important; writing-mode: tb-rl;"&gt;margin-right&lt;/span&gt;&lt;!{{mediawiki.external('endif')}}</span></div>
<p style="margin-top: 270px;"><img alt="Image:offsetWidth.png" src="File:pl/Media_Gallery/OffsetWidth.png"></p>
<h3 name="Specification">Specification</h3>
<p>offsetWidth is part of the MSIE's {{template.Abbr("DHTML", "Dynamic HyperText Markup Language")}} object model.
offsetWidth is not part of any W3C specification or technical recommendation.
</p>
<h3 name="Notes">Notes</h3>
<p>offsetWidth is a property of the {{template.Abbr("DHTML", "Dynamic HyperText Markup Language")}} object model which was first introduced by MSIE. It is sometimes referred as an element physical/graphical dimensions or an element's box width.
</p>
<h3 name="References">References</h3>
<ul><li> <a class="external" href="http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/offsetwidth.asp?frame=true">MSDN's offsetWidth definition</a>
</li><li> <a class="external" href="http://msdn.microsoft.com/workshop/author/om/measuring.asp">MSDN's Measuring Element Dimension and Location</a>
</li><li> <a class="external" href="http://www.mozilla.org/docs/dom/domref/dom_el_ref22.html">Gecko DOM Reference on offsetWidth</a>
</li></ul>
{{ wiki.languages( { "en": "en/DOM/element.offsetWidth" } ) }}
Przywróć do tej wersji