BUG: HTML+TIME Code Fails Inside an Element Behavior (298397)



The information in this article applies to:

  • Microsoft Internet Explorer (Programming) 5
  • Microsoft Internet Explorer (Programming) 5.01
  • Microsoft Internet Explorer (Programming) 5.01 SP1
  • Microsoft Internet Explorer (Programming) 5.5

This article was previously published under Q298397

SYMPTOMS

When you use HTML+TIME code inside an element behavior, HTML+TIME does not work correctly. The HTML+TIME effect is not initialized.

CAUSE

Current HTML+TIME implementation depends heavily on the HTMLWindow events and starts with the onLoad event. Because element behavior does not have an HTMLWindow event, HTML+TIME does not start.

RESOLUTION

To work around this problem, place your HTML+TIME code outside an element behavior.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new HTML page named Work.htm, and paste the following code:
    <HTML XMLNS:t ="urn:schemas-microsoft-com:time">
    <HEAD>
    <?IMPORT namespace="t" implementation="#default#time2">
    <STYLE>
      .time    { behavior: url(#default#time2); }
    </STYLE>
    </HEAD>
    
    <BODY ID="oBody">
    <DIV ID="oDiv" style="position:absolute; top:50; left:20; background-color:red;">
      Animated DIV that with move from left to right over time.
    
      <t:animateMotion begin="1" dur="3" calcMode="spline"
       keySplines="0 .75 .5 1"  keyTimes="0;1" values="20,0;300,0"
       fill="hold"/>
    
    </DIV>
    
    </BODY>
    </HTML>
    					
  2. In Internet Explorer, browse to Work.htm. Notice that the red color DIV element moves from left to right over time.
  3. Create a new HTML Component file named Mytime.htc, and paste the following code that is based on the preceding code:
    <public:component tagName="animSquare">
    
    <public:defaults viewLinkContent/>
    
    
    <HTML XMLNS:t ="urn:schemas-microsoft-com:time">
    <HEAD>
    <?IMPORT namespace="t" implementation="#default#time2">
    <STYLE>
      .time    { behavior: url(#default#time2); }
    </STYLE>
    </HEAD>
    
    <BODY ID="oBody">
    <DIV ID="oDiv" style="position:absolute; top:50; left:20; background-color:yellowgreen;">
      Animated DIV that with move from left to right over time.
    
      <t:animateMotion begin="1" dur="3" calcMode="spline"
       keySplines="0 .75 .5 1"  keyTimes="0;1" values="20,0;300,0"
       fill="hold"/>
    
    </DIV>
    
    </BODY>
    </HTML>
    </public:component>
    
    					
  4. Create a new HTML page named Fail.htm, and paste the following code:
    <HTML XMLNS:MYTIME>
    <HEAD>
    <?IMPORT namespace="MYTIME" implementation="Mytime.htc" />
    </HEAD>
    <BODY>
    
    <MYTIME:animSquare  value ="T2"/>
    
    </BODY>
    </HTML>
    					
  5. In Internet Explorer, browse to Fail.htm. Notice that the DIV element does not move.

REFERENCES

For more information about HTML+TIME, see the following Microsoft Web site: For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

Modification Type:MajorLast Reviewed:5/11/2006
Keywords:kbbug kbDHTML kbpending KB298397