Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


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

Chapter 11. Animating and Scripting SVG > The animateMotion Element

11.7. The animateMotion Element

By using translate with the <animateTransform> element, you can cause an object to animate along a straight-line path. The <animateMotion> element lets you do this as well; additionally, it allows you to animate an object along an arbitrary path.

If you insist on using <animateMotion> for straight-line motion, you simply set the from and to attributes, assigning them each a pair of (x, y) coordinates. Example 11-13 moves a grouped circle and rectangle from (0,0) to (60,30).


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial