Compartir a través de


mediaWidth Property

This topic documents a feature of HTML+TIME 2.0, which is obsolete as of Windows Internet Explorer 9.

Gets the width of the element.

Syntax

HTML N/A
Scripting [ iWidth = ] object.mediaWidth

Possible Values

iWidth Integer that receives the width of the element, in pixels.

The property is read-only. The property has no default value.

Remarks

This property represents the actual width of the media file as stored. By default, the media element renders at the width specified in the media file.

Example

This example uses the mediaWidth property to get the width of the media element.

<HTML XMLNS:t="urn:schemas-microsoft-com:time">
<HEAD>
<TITLE>mediawidth Property</TITLE>
<?IMPORT namespace="t" implementation="#default#time2">

<STYLE>
    .time{ behavior: url(#default#time2);}
</STYLE>
</HEAD>

<BODY TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF"
    LINK="#000000" VLINK="#808080" ALINK="#000000">
<B>Timer:</B>
<SPAN id="Timer" class="time" dur=".01" repeatCount="indefinite" fill="hold"
    onrepeat="innerText=parseInt(document.body.currTimeState.activeTime);">0
    </SPAN>
<BR><BR>

<t:video id="m1" src="/workshop/samples/author/behaviors/media/shuttle3.wmv"/>

<BR><BR>
<SPAN id="mediawidth1">Media width:</SPAN>

<BR><BR>
<BUTTON id="b1" onclick="mediawidth1.innerText='Media width: ' + 
    m1.mediawidth + ' pixels.'">Click here for the width of the media element
    </BUTTON>
</BODY>
</HTML>

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/behaviors/mediawidth.htm

Applies To

t:ANIMATION, t:AUDIO, t:IMG, t:MEDIA, t:PAR, t:REF, t:SEQ, t:VIDEO

See Also

Introduction to HTML+TIME, mediaHeight