speed参数属性 | DHTML中文手册 |
Retrieves the playback speed of an element at run time, which includes the cascading effect of the speed set for the parent time container.
dhtml语法
[ fcurrSpeed = ] currTimeState.speed
DHTML可能的值
fcurrSpeed Floating-point that receives the run-time speed of an element. The property is read-only. The property has no default value.
Remarks
The value of this read-only property reflects the speed settings inherited by the element from its parent time container. For example, if the speed properties of both an element's parent time container and the element itself are set to 0.5, the element plays back at 25% of its normal playback speed. in other words, the parent plays at 50% speed and the child plays at 50% of the parent speed, yielding a 25% playback speed for the child.
DHTML代码范例
The following example accesses an element's speed property at run time. Click the buttons to see the difference between the speed of the video element and the value of the speed property exposed by the currtimestate object. in this case, the speed value is the product of speed settings for the element and its parent.
<html xmlns:t ="urn:schemas-microsoft-com:time"> <HEAD> <TITLE>speed Property</TITLE> <STYLE> .time{ behavior: url(#default#time2);} </STYLE> <?IMPORT namespace="t" implementation="#default#time2"> </HEAD> <BODY> <t:PAR id="p1" SPEED="2" > <t:VIDEO id="v1" BEGIN="1" style="position:absolute; top:80px; left:20px; height:100px;" src="shuttle3.wmv" speed="1.5" /> </t:PAR> <BUTTON class="time" style="position:absolute;top:200px" repeatCount="indefinite" onclick="alert('Run time speed: ' + v1.currTimeState.speed);"> Run time speed</BUTTON> <BUTTON class="time" style="position:absolute;top:200px;left:150px" repeatCount="indefinite" onclick="alert('Video element speed: ' + v1.speed);"> Video element speed</BUTTON> </BODY> </HTML>
applies to
currTimeState
更多语法参考
Introduction to HTML+TIME