asp.net.ph

Skip Navigation Links

pixelWidth Property

DHTML Object Properties   DHTML Objects


Sets or retrieves the width of the object, in pixels.

Syntax


HTML N/A
Script object.style.pixelWidth [ = iWidth ]

Possible Values


iWidth Integer value specifying the width, in pixels.

The property is read/write with no default value.

Remarks

Setting this property changes the value of the width without changing the units designator. Unlike the width property, this property's value is an integer, not a string, and is always interpreted in pixels.

For more information on how to access the dimension and location of objects on the page through the document object model, see Measuring Element Dimension and Location.

Example

In the following sample, the pixelWidth is incremented through use of a timer.

<script language="JavaScript">
function scaleThis ( ) {
if ( sphere.style.pixelWidth <900 ) {
  sphere.style.pixelWidth += 4;
  sphere.style.pixelHeight += 4;
  window.setTimeout ( "scaleThis ( );", 1 );
  }
}
</script>

This feature requires Microsoft® Internet Explorer® 4.0 or later.

 Show me 

See Also

posWidth



>

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note