网页特效:当你指向某个链接时,网页中的图片会自动跑过去

网页特效:当你指向某个链接时,网页中的图片会自动跑过去,第1张

网页特效:当你指向某个链接时,网页中的图片会自动跑过去,第2张

当你指向某个链接时,网页中的图片会自动跑过去。要完成此效果把如下代码加入到区域中

  
  <script language="Javascript" type="text/javascript">
  function lib_bwcheck(){ //Browsercheck (needed)
   this.ver=navigator.appVersion
   this.agent=navigator.userAgent
   this.dom=document.getElementById?1:0
   this.opera5=this.agent.indexOf("Opera 5")>-1
   this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
   this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
   this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
   this.ie=this.ie4||this.ie5||this.ie6
   this.mac=this.agent.indexOf("Mac")>-1
   this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
   this.ns4=(document.layers && !this.dom)?1:0;
   this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
   return this
  }
  var bw=new lib_bwcheck()
  numItems = 4
  circleXstart = 10
  circleYstart = -25
  circleXoffset = 5
  circleYoffset = -3
  circlePXspeed = 5
  circleTspeed = 10
  circleStay = 1
  function makeObj(obj,nest,x,y){
   nest = (!nest)?"":'document.'+nest+'.'
   this.css = bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0
   this.evnt = bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?this.css:0
   this.showIt = b_showIt
   this.moveIt = b_moveIt
   this.slide = b_slide
   this.slideIt = b_slideIt
   this.obj = obj+"Object"
   eval(this.obj+"=this")
   return this
  }
  var px = bw.ns4||window.opera?"":"px";
  function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x+px; this.css.top=this.y+px;}
  function b_showIt(){this.css.visibility="visible"}
  function b_slideIt(endx,endy,inc,speed,fn,wh) {
   if (!this.slideactive) {
   var distx = endx - this.x
   var disty = endy - this.y
   var num = Math.sqrt(Math.pow(distx,2) + Math.pow(disty,2))/inc
   var dx = distx/num
   var dy = disty/num
   this.slideactive = 1
   this.slide(dx,dy,endx,endy,speed,fn,wh)
   }
  }

位律师回复
DABAN RP主题是一个优秀的主题,极致后台体验,无插件,集成会员系统
白度搜_经验知识百科全书 » 网页特效:当你指向某个链接时,网页中的图片会自动跑过去

0条评论

发表评论

提供最优质的资源集合

立即查看 了解详情