JavaScript Tutorial/Animation/Text — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 11:24, 26 мая 2010
Animation by changing both pixelTop and pixelLeft (IE)
<source lang="javascript">
<html> <head> <title>A Simple Page</title> <script language="JavaScript">
</script> </head> <body onLoad="moveTxt()">
Text ... on the go!
</body> </html></source>
Text animation
<source lang="javascript">
<html> <head> <style> div { position:relative; } </style> <title>Animating Text</title> <SCRIPT LANGUAGE="JavaScript" type = "text/javascript"> var pos1 = 0; function f() {
pos1 += 5; if (pos1 > 640) pos1 = 0; document.getElementById("movetext").style.left = pos1; window.setTimeout("f();",300);
} </SCRIPT> </head> <body onLoad="f();">
inside a div
</body> </html></source>