onOffBehavior Property?deprecated) | DHTML中文手册 |
retrieves an object indicating whether the specified microsoft?directanimation?behavior is running.
dhtml语法
html n/a scripting [ oon = ] object.onoffbehavior
dhtml可能的值
oOn DirectAnimation Boolean (DABoolean) object that specifies one of the following values.
true Behavior is running. false Behavior is not running. The property is read-only. The property has no default value.
Remarks
This property is deprecated.
This property allows you to incorporate multimedia elements, such as 2-D and 3-D animated images and sounds, into an HTML page using the anim:da element. the object this property is applied to must be an html object with a valid html+time (timed interactive multimedia extensions) timeline. use this property with html+time timelines to control directanimation content. this property is not part of the html+time specification.
Note To ensure that pages using this property display properly in Microsoft Internet Explorer, complete the following steps.
- Use #time instead of #default#time for the behavior declaration.
- Include the time object in your page. The class identifier used to specify this object is 476C391C-3E0D-11D2-B948-00C04FA32195.
These actions are necessary only for pages that use HTML+TIME timelines to control DirectAnimation content.
DHTML代码范例
This example attaches a timeline specified with HTML+TIME to an image animated with DirectAnimation. The onOffBehavior property is used to display one image while the animation is running, and to display a different image while the animation is stopped.
<HTML> <HEAD> <TITLE>progressBehavior</TITLE> <XML:NAMESPACE PREFIX="anim"/> <STYLE> .time { behavior: url(#time); } anim\:DA { behavior: url(#default#anim); } </STYLE> <OBJECT ID="time" CLASSID="CLSID:476C391C-3E0D-11D2-B948-00C04FA32195"> </OBJECT> </HEAD> <BODY> <P>An image of the sun is displayed before the DirectAnimation behavior starts. Five seconds later, a new image replaces the image of the sun. The new image fades out during five seconds of animation, and the original image of the sun reappears.</P> <SPAN ID="spanImg" CLASS="time" t:TIMEACTION="visibility" t:BEGIN="5" t:DUR="5"> </SPAN> <DIV ALIGN="center"> <anim:DA ID="da1" STYLE="width:504; height:126; z-index: -1;" /> </DIV> <BR> <BUTTON onclick="spanImg.beginElement();">Restart</BUTTON> <SCRIPT LANGUAGE="JScript"> <!-- // Assign a variable to the DA statics library m = da1.statics; // Create the DAImages img1 = m.ImportImage("../../common/solarsys.gif"); img2 = m.ImportImage("../../common/sun.gif"); // Display image 1 while the behavior is running, and // image 2 while it is stopped. img3 = m.Cond(spanImg.onOffBehavior, img1, img2) // Animate the opacity of the image from 100% to 0%, based on the // progress of the time behavior. Use (1 - progress) to get the // proper opacity. img4 = img3.OpacityAnim(m.Sub(m.DANumber(1),spanImg.progressBehavior)); // Set the image of the DA Object to be the final image behavior da1.image = img4; //--> </SCRIPT> </BODY> </HTML>
是否符合公共标准
This property is defined in HTML+TIME 1.0 .
Applies To
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, currentStyle, CUSTOM, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FORM, hn, HTML, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, ISINDEX, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OL, OPTION, P, PLAINTEXT, PRE, runtimeStyle, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP
更多语法参考
progressbehavior, timelineBehavior