<script language="JavaScript">
<!
var images=
;//Put your image name here!!
var amount=
; //Number of images here!!
var yBase =
;
var xBase =
;
var step =
;
var currStep =
;
var Xpos =
;
var Ypos =
;
var i =
;
var j =
;
if (document
all)
{
document
write(
<div id="ieDiv" style="position:absolute;top:
px;left:
px">
)
document
write(
<div id="c" style="position:relative">
);
for (n=
; n < amount; n++)
document
write(
<img src="
+images+
" style="position:absolute;top:
px;left:
px">
)
document
write(
</div>
)
document
write(
</div>
)
function MsieMouseFollow(){
Xpos = document
body
scrollLeft+event
x
;
Ypos = document
body
scrollTop+event
y
;
}
document
onmousemove = MsieMouseFollow;
}
else if (document
layers)
{
window
captureEvents(Event
MOUSEMOVE);
for (ns=
; ns < amount; ns++)
document
write("<LAYER NAME=
n"+ns+"
LEFT=
TOP=
><IMG SRC=
"+images+"
></LAYER>");
function NsMouseFollow(evnt){
Xpos = evnt
pageX
;
Ypos = evnt
pageY
;
}
window
onMouseMove = NsMouseFollow;
}
function Swirl(){
if (document
all)
{
yBase = window
document
body
offsetHeight/
;
xBase = window
document
body
offsetWidth/
;
}
else if (document
layers)
{
yBase = window
innerHeight/
;
xBase = window
innerWidth/
;
}
if (document
all)
{
for (i=
;i<ieDiv
all
c
all
length;i++)
{
ieDiv
all
c
all[i]
style
top = Ypos + Math
cos((
*Math
sin(currStep/
))+i*
)*yBase*(Math
sin(
+currStep/
)+
)*Math
cos((currStep + i*
)/
);
ieDiv
all
c
all[i]
style
left = Xpos + Math
sin((
*Math
sin(currStep/
))+i*
)*xBase*(Math
sin(
+currStep/
)+
)*Math
cos((currStep + i*
)/
);
}
}
else if (document
layers)
{
for ( j =
; j < ns ; j++ ) //
is number of NS layers!
{
var temp="n"+j
document
layers[temp]
top = Ypos + Math
cos((
*Math
sin(currStep/
))+j*
)*yBase*(Math
sin(
+currStep/
)+
)*Math
cos((currStep + j*
)/
);
document
layers[temp]
left =Xpos + Math
sin((
*Math
sin(currStep/
))+j*
)*xBase*(Math
sin(
+currStep/
)+
)*Math
cos((currStep + j*
)/
);
}
}
currStep += step;
setTimeout("Swirl()"
);
}
Swirl();
//
>
</script>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20155.html