Moving elements |
![]() |
![]() |
Moving elements around in the document If you like working with animations, you'll be glad to know that with DHTML, the entire web page is now your drawing board! You can create content that fly all over the screen freely. In Netscape, this is done by manipulating the left and top attributes of the <layer> tag. In IE 4, the same thing is accomplished by altering the pixelLeft and pixelTop properties of the style object. -Moving elements in NS 4 Recall in lesson 2 that layers support the left and top property, which controls its offset from the document's upper left corner. Well, by using simple math and a couple of lines of script, we can dynamically update these properties so the layer moves! The below example changes the left property of a layer so it moves horizontally when a button is pressed.
kk |
![]() |
![]() |