dw鼠标代码让鼠标变样
鼠标轨迹
鼠标轨迹
源码如下
---------------------------------------------------------------------------------------- 脚本说明:
把如下代码加入<head>区域中
<style type="text/css">
BODY {overflow: scroll; overflow-x: hidden;}
</style>
<SCRIPT LANGUAGE="JavaScript1.2">
<!-- Begin
var trailLength = 8; // The length of trail
var path = "cursor1.gif"; // URL to cursor image
var isIE = false, isNav = false, range = "all.", style = ".style", i, d = 0; var topPix = ".pixelTop", leftPix = ".pixelLeft", images, storage; if (document.layers) {
isNav = true, range = "layers.", style = "", topPix = ".top", leftPix = ".left"; } else if (document.all) {
isIE = true;
}
function initTrail() {
images = new Array();
for (i = 0; i < parseInt(trailLength); i++) {
dw来回滚动代码
images[i] = new Image();
images[i].src = path;
}
storage = new Array();
for (i = 0; i < images.length*3; i++) {
storage[i] = 0;
}
for (i = 0; i < images.length; i++) { // make divs for IE and layers for Navigator (isIE) ? document.write('<div id="obj' + i + '" rtcscls-2-s_r_1 rtcscls-2-s_sn_2_rId_a rtcscls-2-s_r_3_rId_a rtcscls-2-s_sn_10_rId_p rtcscls-2-s_p_11_rId_p rtcscls-2-r_0">0"><img src="' + images[i].src + '"></div>') : document.write('<layer name="obj' + i + '" width="0"
height="0" z-index="100"><img src="' + images[i].src + '"></layer>'); }
trail();
}
function trail() {
for (i = 0; i < images.length; i++) {
eval("document." + range + "obj" + i + style + topPix + "=" + storage[d]);
eval("document." + range + "obj" + i + style + leftPix + "=" + storage[d+1]);
d = d+2;
}
for (i = storage.length; i >= 2; i--) {; storage[i] = storage[i-2];
}
d = 0;
clearTimeout(timer);
var timer = setTimeout("trail()", 10); }
function processEvent(e) {
if (isIE) {
storage[0] = window.event.y+document.body.scrollTop+10;
storage[1] = window.event.x+document.body.scrollLeft+10;
} else {
storage[0] = e.pageY+12;
storage[1] = e.pageX+12;
}
}
if (isNav) {
document.captureEvents(Event.MOUSEMOVE); }
if (isIE || isNav) {
initTrail();
usemove = processEvent; }
// End -->
</script>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论