查看完整版本: 鼠标美化代码

JXM123 2008-5-11 14:48

鼠标美化代码

代码:

<SCRIPT LANGUAGE="JavaScript">
if (document.all) {
yourplmm = "这里填加旋转的文字";
plmmFont = "宋体";
plmmColor = "green";
plmmWeight = "bold";
yourplmm = yourplmm.split('');
L = yourplmm.length;
TrigSplit = 360 / L;
Sz = new Array()
plmmWidth = 100;
plmmHeight = -30;
ypos = 0;
xpos = 0;
step = 0.03;
currStep = 0;
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" style="position:absolute;top:0px;left:0px;'
+'width:10px;height:10px;font-family:'+plmmFont+';font-size:12px;'
+'color:'+plmmColor+';font-weight:'+plmmWeight+';text-align:center">'+yourplmm+'</div>');
}
document.write('</div></div>');
function Mouse() {
ypos = event.y;
xpos = event.x - 5;
}
document.onmousemove=Mouse;
function animateplmm() {
outer.style.pixelTop = document.body.scrollTop;
for (I = 0; I < L; I++) {
ie.style.top = ypos + plmmHeight * Math.sin(currStep + I * TrigSplit * Math.PI / 180);
ie.style.left = xpos + plmmWidth * Math.cos(currStep + I * TrigSplit * Math.PI / 180);
Sz = ie.style.pixelTop - ypos;
if (Sz < 5) Sz = 5;
ie.style.fontSize = Sz / 1.7;
}
currStep -= step;
setTimeout('animateplmm()', 20);
}
window.onload = animateplmm;
}
</script>


复制代码后, 放在论坛后台其它头部里即可
效果展示: 看本论坛的鼠标周围的旋转文字
其中"这里填加旋转的文字"改你想改的字!

lanow 2008-5-11 17:08

很好!这样很个性!:handshake
页: [1]
查看完整版本: 鼠标美化代码
查看完整版本: 鼠标美化代码