fingh 发表于 2007-4-27 10:58:47

***页面背景***用几个rodio组合在一起,可以用来代替水平线

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果需要两个步骤

第一步:把如下代码加入到<head>区域中

<!--





// create row of radio buttons

lay(20)



// set index of lamp to start animation

var current = 0



// set speed (pause in milliseconds between each movement)

var speed = 50



function lay(num) {

      // assign "greater than" character to variable

      var gt = unescape("%3e")



      // open form

      document.write("<center><form name='animation'" + gt)



      // use loop to lay radio buttons down (all buttons in same group)

      for (var i = 0; i < num; ++i) {

                document.write("<input type='radio' name='lamps'" + gt)


      }



      // close form

      document.write("</form" + gt)

}



function animate() {

      // click next radio button

      document.animation.lamps.click()



      // if radio button is the last one reset variable to 0 (otherwise increment)

      current = (current == document.animation.lamps.length - 1) ? 0 : ++current



      // recursive call after speed milliseconds

      timerid = settimeout("animate()", speed)

}



// -->



</script>


第二步:把“onload="animate()"”加在<body>标记里
例如:<body onload="animate()">
      











--------------------- -- ---------------

http : //w ww.huoyue.com .cn 活跃网,活跃人群的论坛, 访问活跃网,将给您带来意想不 到的收获 ,还可以免费为您开论坛,让您免费拥有与朋友、网友交 流的论坛。你是年轻人吗?你 活跃你 就上!
页: [1]
查看完整版本: ***页面背景***用几个rodio组合在一起,可以用来代替水平线