VB 源码VC 源码ASP源码JSP源码PHP源码CGI源码FLASH源码素材模板C 源程序常用软件文档中心其他程序

网页设计

网页设计
平面设计
三维设计
动画设计
综合设计
搜索优化

本类阅读TOP10

·经典网页设计欣赏
·网页效果集合
·下拉菜单全攻略(Javascript篇)
·Dreamweaver网页编辑技巧十八例
·下拉菜单全攻略(DW篇)
·网页布局设计基础
·主页javascript特效19则
·网页背景设计全攻略
·让网页适应不同尺寸的显示器
·精华代码集

精品推荐
透明鼠标跟随

作者:佚名 来源:本站原创 加入时间:2003-9-15 月光软件站

      这次的鼠标跟随用到了透明,本来这个脚本的效果只是尾巴处拖动一串的图片,然后重叠在一起,我加了一个透明,这样移动鼠标的时候因为图片透明的缘故,就有了慧尾的效果,渐变透明的尾巴跟在后面,效果不错。

演示地址:点击这里

html部分:
--------------------------------------------------------------------------------------------------
<html>
<head>
<title>javascriptboy</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<style type="text/css">
BODY {overflow: scroll; overflow-x: hidden;}
img { filter: Alpha(Opacity=25)}
</style>
<body bgcolor="#FFFFFF" text="#000000">
<script language="javascript1.2">
<!--
var trailLength = 20 // The length of trail (8 by default; put more for longer "tail")
var path = "cursor.gif" // 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 = new Image()
images.src = path
}
storage = new Array() // prepare the storage for the coordinates
for (i = 0; i < images.length*3; i++) {
storage = 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.src + "></div>) : document.write(<layer name="obj + i + " width="0" height="0" z-index="100"><img src=" + images.src + "></layer>)
}
trail()
}
function trail() { // trailing function
for (i = 0; i < images.length; i++) { // for every div/layer
eval("document." + range + "obj" + i + style + topPix + "=" + storage[d]) // the Y-coordinate
eval("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 thats behind
storage = 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>
</body>
</html>




相关文章
  • 懒人奇招:给鼠标右键添最快绿色通道
  • Flash 3d效果实例--鼠标3D感应(下)
  • Flash 3d效果实例--鼠标3D感应(上)
  • 相关软件

  • 黑鼠标源程序  
  • 当你的鼠标在动时按纽也在动让你很难捕捉到  
  • 这个类库是对鼠标敏感的按纽  
  • 改变鼠标形状的例子  
  • 支持滚动文字图象,并可用鼠标操作方向。  
  • 字符串处理,鼠标开发,复数处理C++类库  
  • 鼠标功能开发 C 语言源程序  
  • 鼠标中断高级开发功能  
  • MICE鼠标驱动程序开发C语言源程序库  
  • C语言开发使用键盘和鼠标演秦MIDI  



  • 月光软件程序下载编程文档电脑教程网站设计网址导航网络文学游戏天地幽默笑话生活休闲写作范文安妮宝贝
    电脑技术编程开发网络专区谈天说地情感世界游戏元素分类游戏热门游戏体育运动手机专区业余爱好影视沙龙
    音乐天地数码广场教育园地科学大观古今纵横谈股论金人文艺术医学保健动漫图酷二手专区地方风情各行各业

    月光软件站·版权所有