- <head>
- <SCRIPT LANGUAGE="JavaScript">
-
- posi = 0;
- function Vibre2()
- {
- if(posi<160)
- {
- if(posi/2 == Math.round(posi/2))
- {
- X = Math.round(Math.random()*40)-20;
- Y = Math.round(Math.random()*40)-20;
- window.moveBy(X,Y);
- }
- else
- window.moveBy(-X,-Y);
- posi++;
- tempo=setTimeout('Vibre2()', 10);
- }
- }
- Vibre2()
- </SCRIPT>
- </head>
-
-
- ou
-
-
- // Function - Shake()
- // Description - shake the screen
- function shake(n) {
- for (i = 10; i > 0; i--) {
- for (j = n; j > 0; j--) {
- // Shake the window
- // Moveby (x,y) where x = number of pixels to move the window to the right
- // and y is the number of pixels to move the window down
- self.moveBy(0,i);
- self.moveBy(i,0);
- self.moveBy(0,-i);
- self.moveBy(-i,0);
- }
- }
- }
-
<head>
<SCRIPT LANGUAGE="JavaScript">
posi = 0;
function Vibre2()
{
if(posi<160)
{
if(posi/2 == Math.round(posi/2))
{
X = Math.round(Math.random()*40)-20;
Y = Math.round(Math.random()*40)-20;
window.moveBy(X,Y);
}
else
window.moveBy(-X,-Y);
posi++;
tempo=setTimeout('Vibre2()', 10);
}
}
Vibre2()
</SCRIPT>
</head>
ou
// Function - Shake()
// Description - shake the screen
function shake(n) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
// Shake the window
// Moveby (x,y) where x = number of pixels to move the window to the right
// and y is the number of pixels to move the window down
self.moveBy(0,i);
self.moveBy(i,0);
self.moveBy(0,-i);
self.moveBy(-i,0);
}
}
}