SiteExperts.com Logo Home | Community | Developer's Paradise | Jobs
User Groups | Site Tools | Site Information | Search

Inside Technique : Steve's Behaviors : move Behavior

The move behavior make sit easy to add animation to elements. In Internet Explorer 5.0, the paragraph below animates down from the top of the screen. In all other browser, the paragraph is properly displayed and the animation is ignored.

This behavior is defined by MOVE.htc. It supports the following properties: startX, startY, endX, endY which should be self explanatory. speed is the number of pixels to move per millisecond. and offStart is the number of milliseconds to wait to start after the page loads. If offStart is not present, the move does not begin until the moveo() method is called (eg., id.moveo()). When the move is complete, the onMoveDone event is fired on the element.

The above paragraph is wrapped in a DIV and is associated with the move behavior as follows:

<div id=mv1 style="behavior: url(move.htc); 
                   width: 100%; 
                   background: lightgrey; 
                   border: 1 black solid" 
     offStart 
     startY=-250>
     speed=50
  <p>...text...
</div>

Page 1:Steve's Behaviors
Page 2:move Behavior
Page 3:fade Behavior
Page 4:bubble Behavior
Page 5:type Behavior
Page 6:switch Behavior
Page 7:over Behavior
Page 8:float Behavior