| You are here : Web design > JavaScript > Miscellaneous scripts | DinkostaOnline |
|
| Scripts that didn't fit into the other categories, I've decided to label Miscellenous scripts and to devide them into two parts. In the first part of these scripts you can see an example of a date and time in titlebar script and the appropriate code if you want to use it for your site. The second topic is about dynamic web pages with external JavaScript files. In the second part you can see an example of a very simple calculator and examples of using ASCII code in JavaScript. Every example is with the appropriate code to cut and paste it onto your site or use it for some other purpose. |
Here is a simple script that demonstrates how to create animation and move objects with JavaScript.<script>Put the animation object and the buttons into the body of the document: |
<body><div id=ani style="position:relative"><img src="avion.gif"></div><button onclick=mov()>Go</button><button onclick=naz()>Come back</button>![]() To get vertical movement use pixelTop instead of pixelLeft and to change the speed of the animation increase or decrease the value in the third line (+=5). Putting a minus sign instead of the plus sign in front of this value will change the direction. |