图片展示器

来源:互联网 发布:java tcp nat穿透 编辑:程序博客网 时间:2024/04/28 19:42
  1.  <div id='div1' style="border:1px solid #c0c0c0;width:293px;height:66px;overflow:hidden;position:absolute;top:100px;left:100px;">
  2. <div id="first" style="position:absolute;;top:2px;left:2px;height:64px;width:289px;">
  3. <img src="http://i2.sinaimg.cn/IT/images/2008-07-04/U1960P2T78D12794F1070DT20080704163744.jpg" width="90" height="60" alt="古楼遗风" />
  4. <img src="http://i2.sinaimg.cn/IT/images/2008-07-04/U1960P2T78D12794F3303DT20080704164135.jpg" width="90" height="60" alt="夕光涟潋" />
  5. <img src="http://i3.sinaimg.cn/IT/images/2008-07-04/U1960P2T78D12794F3304DT20080704164656.jpg" width="90" height="60" alt="爱之缠绵" />
  6. </div>
  7. <div id="second"  style="position:absolute;top:2px;left:294px;height:64px;width:289px;">
  8. <img src="http://i1.sinaimg.cn/IT/images/2008-07-04/U1960P2T78D12794F3305DT20080704165504.jpg" width="90" height="60" alt="欢乐瞬间" />
  9. <img src="http://i2.sinaimg.cn/IT/images/2008-07-04/U1960P2T78D12794F3306DT20080704171426.jpg" width="90" height="60" alt="台岛奇观" />
  10. <img src="http://i3.sinaimg.cn/IT/images/2008-07-04/U1960P2T78D12794F3307DT20080704173213.jpg" width="90" height="60" alt="天堑变通途" />
  11. </div>
  12. </div>
  13. </BODY>
  14. </HTML>
  15. <SCRIPT LANGUAGE="JavaScript">
  16. <!--
  17. var d=document,f =  d.getElementById('first'),s = d.getElementById('second');
  18. function move(){
  19. var timer = setInterval(function(){
  20. if(s.offsetLeft+s.offsetWidth<0||f.offsetLeft+f.offsetWidth<0){
  21. clearInterval(timer);
  22. f.offsetLeft+f.offsetWidth<0?(f.style.left = s.offsetLeft + s.offsetWidth +2+ 'px'):(s.style.left = f.offsetLeft + f.offsetWidth +4+ 'px')
  23. setTimeout(move,2000);
  24. }
  25. else{
  26. f.style.left = f.offsetLeft - 2 + 'px';
  27. s.style.left = s.offsetLeft - 2 + 'px';
  28. }
  29. },10)
  30. }
  31. setTimeout(move,2000);
  32. //-->
  33. </SCRIPT>
原创粉丝点击