鼠標軌跡,原理很簡單
圖像文件:
請將此文件與網頁文件保存在同目錄下
<script language=JavaScript1.2>
var trailLength = 8;
var path ="images/cursor1.gif";
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 ) {
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 ) {
(isIE) ? document.write('
0條評論