- Fade Effect
- Roll-in or Roll-out
- Page-in or Page-out
- Object movements
- setTimeout (function, duration) - This function calls the Function after the duration (in milliseconds) from now.
- setInterval (function, duration) - This function calls the function after each duration (in milliseconds).
- clearTimeout (setTimeout_variable) - This function removes any timer set by the setTimeout () function.
// Set distance from left edge of the screen. object . style . left = distance in pixels or points ; or // Set distance from top edge of the screen. object . style . top = distance in pixels or points ;
Hand operation animation
We are using the getElementById () function to get a DOM object and then assign it to a Global variable, imgObj .
We have defined an initialization function init () to initialize imgObj , where we have set its position and left properties.
We are calling the initialization function at the time of loading the window.
Finally, we are calling moveRight () function to increase the left distance by 10 pixels. You can also set it to a negative value to move it to the left.
Try the following example:
- How to copy and insert animated GIFs?