|
|
|
Window
Shake
Ever wonder how to shake a window?
Put the below code between the head tags:
CODE |
<script language="JavaScript1.2">
function shake_xy(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(i,0);
self.moveBy(0,-i);
self.moveBy(-i,0);
}
}
}
}
function shake_x(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(i,0);
self.moveBy(-i,0);
}
}
}
}
function shake_y(n) {
if (self.moveBy) {
for (i = 10; i > 0; i--) {
for (j = n; j > 0; j--) {
self.moveBy(0,i);
self.moveBy(0,-i);
}
}
}
}
</script>
|
Put this code in a link:
For xy shaking:
CODE |
<A HREF =
"javascript:shake_xy(3)">Shake XY</A>
|
For x shaking:
CODE |
<A HREF =
"javascript:shake_x(4)">Shake X</A>
|
Tutorial By Xtasy
|
|