网页特效 一“码”当先──弹簧文字

Author: Date: 2001年 41期

?牐犜?<head>中适当位置加入如下代码:
  ?牐?<script language="JavaScript">
  ?牐?<!--
  ?牐爒ar sizes=new Array("-2px","-1px","0px","1px","2px""3px","4px")
  ?牐?"5px","6px","7px","8px","9px","10px","11px","12px","13px"?牔?
  ?牐爏izes.pos=0;??
  ?牐爁unction rubberBand()?煟?
  ?牐牓煟?
  ?牐爒ar el=document.all.elastic;??
  ?牐爄f(null==el.direction)??
  ?牐爀l.direction=1;??
  ?牐爀lse if((sizes.pos>sizes.length-2)||(0==sizes.pos))?牐?
  ?牐爀l.direction*=-1??
  ?牐爀l.style.letterSpacing=sizes[sizes.pos+=el.direction];?牔?
  ?牐牓?
  ?牐?-->
  ?牐?</script>
  ?牐?<body>改为<body onload="setInterval('rubberBand()',150)">,然后在body后适当位置加入如下代码:
  ?牐?<center>
  ?牐?<h2 id="elastic">弹簧文字
  ?牐?</h2>
  ?牐?</center>
  ?牐牭比豢稍谏鲜龃胫屑尤胛淖值拇笮『脱丈龋庋突岢鱿稚拾哽档奈淖窒竦梢谎笥疑焖酢?