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

Chapter 18. Animating Layers > How JavaScript Animation Works

How JavaScript Animation Works

Before plunging into Dreamweaver timelines, tweening, and sprites, it’s important to have a basic idea of how JavaScript animation works. From the previous chapters, you know how a JavaScript statement can alter the properties of a layer or other page element in reaction to some event. You also know that different browsers require different syntax to make this happen. For Internet Explorer, the following very basic function will move the layer on the page by changing its left property:

function moveLayer() {
var pos1 = myLayer.style.left; 
var pos2 = parseInt(pos1) + 20; 
myLayer.style.left = pos2; 
}


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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