ITeye博客

鼠标事件(形成光圈环绕鼠标)

noblemoon · 2011-01-25 14:44 · Web前端 · Markdown

if (document.all) { yourLogo = "可以运动的 比较有意思的 鼠标光圈js! "; logoFont = "黑体"; logoColor = "#FF33FF"; 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; document.write(''); for (i = 0; i < L; i++) { document.write(''+yourLogo*+''); } document.write(''); function Mouse() { ypos = event.y; xpos = event.x - 5; } document.onmousemove=Mouse; function animateLogo() { outer.style.pixelTop = document.body.scrollTop; for (i = 0; i < L; i++) { ie*.style.top = ypos + logoHeight * Math.sin(currStep + i * TrigSplit * Math.PI / 180); ie*.style.left = xpos + logoWidth * 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('animateLogo()', 20); }

window.onload = animateLogo;

}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。