双击鼠标滚动屏幕的代码

//双击鼠标滚动屏幕的代码
  var currentpos,timer;
  function initialize()
  {
  timer=setInterval ("scrollwindow ()",30);
  }
  function sc()
  {
  clearInterval(timer);
  }
  function scrollwindow()
  {
  currentpos=document.body.scrollTop;
  window.scroll(0,++currentpos);
  if (currentpos !=document.body.scrollTop)
  sc();
  }
  document.onmousedown=sc
  document.ondblclick=initialize 
posted on 2013-05-23 17:05  wy007  阅读(395)  评论(0编辑  收藏  举报