• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

13. Positioning HTML Elements > 13.9. Animating Straight-Line Element Paths

Animating Straight-Line Element Paths

NN 6, IE 5

Problem

You want to animate the position of an element from one coordinate to another on the page along a straight-line path.

Solution

To animate a positioned element along a straight-line path, link the animeLine.js library (Example 13-2 in the Discussion) to your page and invoke the initSLAnime( ) function with at least the first five parameters in the following sequence:

  1. ID of the positioned element (as a string)

  2. x coordinate of the starting position

  3. y coordinate of the starting position

  4. x coordinate of the ending position

  5. y coordinate of the ending position

For example:

initSLAnime("floater", 100, 100, 400, 360);

Discussion


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint