|
↑
Messages >>>
This orbiting 3-D message follows your mouse around the screen. The message, color and font are simple to modify!
Add the below code to the <body> section of your page:
<script
language="javascript"
type="text/javascript">
yourLogo
=
"http://yaldex.com";
logoFont
=
"Arial";
logoColor
=
"#FF0080";
yourLogo
=
yourLogo.split('');
L
=
yourLogo.length;
TrigSplit
=
360
/
L;
Sz
=
new
Array()
logoWidth
=
100;
logoHeight
=
-30;
ypos
=
0;
xpos
=
0;
step
=
0.03;
currStep
=
0;
var
iex =
document.all;
var
ns =
!iex;
document.write('<div
id="outer" style="position:absolute;top:0px;left:0px"><div
style="position:relative">');
for
(i
=
0;
i <
L;
i++)
{
document.write('<div
id="ie'+i+'"
style="position:absolute;top:0px;left:0px;'
+'width:10px;height:10px;font-family:'+logoFont+';font-size:16px;'
+'color:'+logoColor+';text-align:center">'+yourLogo[i]+'</div>');
}
document.write('</div></div>');
if
(ns)
document.captureEvents(Event.MOUSEMOVE);
document.onmousemove=Mouse;
function
Mouse(e)
{
if
(iex)
{
ypos
=
event.y;
xpos
=
event.x
-
5;
}
else
{
ypos
=
e.pageY;
xpos
=
e.pageX;
}
}
function
animateLogo()
{
if
(iex)
outer.style.pixelTop
=
document.body.scrollTop;
else
document.getElementById('outer').style.top
=
document.scrollTop;
for
(i
=
0;
i <
L;
i++)
{
Id='ie'+i;
document.getElementById(Id).style.top
=
ypos +
logoHeight *
Math.sin(currStep
+
i *
TrigSplit *
Math.PI
/
180);
document.getElementById(Id).style.left
=
xpos +
logoWidth *
Math.cos(currStep
+
i *
TrigSplit *
Math.PI
/
180);
if
(iex)
Sz[i]
=
document.getElementById(Id).style.pixelTop
-
ypos;
else
Sz[i]
=
parseInt(document.getElementById(Id).style.top)
-
ypos;
if
(Sz[i]
<
5)
Sz[i]
=
5;
document.getElementById(Id).style.fontSize
=
Sz[i]
/
1.7;
}
currStep
-=
step;
setTimeout('animateLogo()',
20);
}
window.onload
=
animateLogo;</script>
|
→
|