UPDATEMODE Attribute | updateMode Property | DHTML中文手册 |
Specifies or retrieves a value that indicates how the object is to be updated.
dhtml语法
HTML <ELEMENT UPDATEMODE = sMode... > Scripting object.updateMode [ = sMode ]
DHTML可能的值
sMode String that specifies or receives one of the following values.
Auto Automatically assigns a new value to the property being set and updates the object. The property maintains the repeatCount and segmentTime values of the element and is similar to resetting followed by a seekTo for the object. Reset Default. Resets the node to its initial state after the change. The property is read/write. The property has a default value of Reset.
Remarks
The beginElement method called on an object with updateMode set to Reset will be ignored.
The table below describes what attribute/property can be updated and the effects that the updateMode property has on it.
Attribute/Property Behavior dur Recalculates (recalc) the entire timing and does a seek. repeatCount Recalculates (recalc) the entire timing and does a seek. repeatDur Recalculates (recalc) the entire timing and does a seek. autoReverse Recalculates (recalc) the entire timing and does a seek. speed Recalculates (recalc) the entire timing and does a seek. end Updates the end value as necessary. begin Does the equivalent of resetElement. restart No immediate effect. Any future begins or sync arc changes are affected. fill Updates the isOn property as appropriate.
DHTML代码范例
The following example demonstrates how the updateMode property is used. Choose the new speed, updateMode values, and click the "Change to new speed" button to implement the change for the MEDIA object.
<HTML xmlns:t= "urn:schemas-microsoft-com:time"> <HEAD> <?IMPORT namespace="t" implementation="#default#time2"> <STYLE> .time{behavior:url(#default#time2)} </STYLE> <SCRIPT> function doChange(){ oMedia.updateMode = oMode.options.value; oMedia.speed = newspeed.options.value; } </SCRIPT> </HEAD> <BODY> <CENTER> <t:video updateMode="reset" style="width:175px; height:150px;" id="oMedia" src="../../common/samples/author/behaviors/media/movie.avi"/> ... <BR> Select <B>updateMode</B> value: <SELECT name="oMode"> <OPTION value="auto">Auto</OPTION> <OPTION value="reset" selected>Reset</OPTION> </SELECT> <BR> Enter new speed <SELECT name="newspeed"> <OPTION value="0.25">25% Playback Speed</OPTION> <OPTION value="0.5">50% Playback Speed</OPTION> <OPTION value="0.75">75% Playback Speed</OPTION> <OPTION value="1" selected>100% Playback Speed (Default)</OPTION> <OPTION value="2">200% Playback Speed</OPTION> </SELECT><BR> <BUTTON onClick="doChange();">Click to change to new speed</BUTTON> <BUTTON onClick="document.body.beginElement()">Restart</BUTTON> </CENTER> </BODY> </HTML>
Applies To
t:ANIMATION, t:AUDIO, t:IMG, t:MEDIA, t:REF, t:VIDEO
更多语法参考
Introduction to HTML+TIME