Export (0) Print
Expand All

pixelWidth property

Sets or retrieves the width of the object.

Syntax

pixelWidth: <integer>

Property values

integer

An Integer that specifies or receives the width, in pixels.

CSS information

Applies ToAll elements
Mediavisual
Inheritedno
Initial Value

Remarks

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

For more information about how to access the dimension and location of objects on the page through the Dynamic HTML (DHTML) Document Object Model (DOM), see Measuring Element Dimension and Location with CSSOM in Internet Explorer 9.

Examples

This example uses a timer to increment the pixelWidth property.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/pixelWidth.htm


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

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows 2000 Server

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

defaults
runtimeStyle
style
posWidth

 

 

Show:
© 2014 Microsoft