加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

今天不爽,又通宵了,再发一篇,模拟系统鼠标效果 cs首发

(2006-10-05 00:14:13)
效果见我博客,模拟系统鼠标效果,还可以发上来大家一起用
 
代码如下:
<DIV>&nbsp;</DIV>
<STYLE type=text/css>
BODY {overflow: scroll; overflow-x: hidden;}
</STYLE>

<SCRIPT><SCRIPT language=javascript1.2>
<!--
/*
Submitted by Marcin Wojtowicz [zbyrj_001@163.com]
Featured on Website Abstraction (http://blog.sina.com.cn/m/csbeyond)
For this and over 400+ free scripts, visit http://blog.sina.com.cn/m/csbeyond
*/
var trailLength = 8 // The length of trail (8 by default; put more for longer "tail")
var path = "http://s9.sinaimg.cn/orignal/49bf8d50d1fea9307db68" // URL of your image
// do NOT modify anything beyond this point
var isIE = false,isNav = false,range = "all.",style = ".style",i,d = 0
var topPix = ".pixelTop",leftPix = ".pixelLeft",images,storage
if (document.layers) { // browser sniffer
 isNav = true,range = "layers.",style = "",topPix = ".top",leftPix = ".left"
} else if (document.all) {
 isIE = true
}
function initTrail() { // prepares the script
 images = new Array() // prepare the image array
 for (i = 0; i < parseInt(trailLength); i++) {
  images[i] = new Image()
  images[i].src = path
 }
 storage = new Array() // prepare the storage for the coordinates
 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 + '" style="position: absolute; z-Index: 100; height: 0; width: 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() { // trailing function
 for (i = 0; i < images.length; i++) { // for every div/layer
  eval_r("document." + range + "obj" + i + style + topPix + "=" + storage[d]) // the Y-coordinate
  eval_r("document." + range + "obj" + i + style + leftPix + "=" + storage[d+1]) // the X-coordinate
  d = d+2
 }
 for (i = storage.length; i >= 2; i--) { // save the coordinate for the div/layer that's behind
  storage[i] = storage[i-2]
 }
 d = 0 // reset for future use
 var timer = setTimeout("trail()",10) // call recursively
}
function processEvent(e) { // catches and processes the mousemove event
 if (isIE) { // for IE
  storage[0] = window.event.y+document.body.scrollTop+10
  storage[1] = window.event.x+document.body.scrollLeft+10
 } else { // for Navigator
  storage[0] = e.pageY+12
  storage[1] = e.pageX+12
 }
}
if (isNav) {
 document.captureEvents(Event.MOUSEMOVE) // Defines what events to capture for Navigator
}
if (isIE || isNav) { // initiates the script
 initTrail()
 document.onmousemove = processEvent // start capturing
}
//-->
</SCRIPT>

<DIV></DIV>

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有