Js double click mouse automatically scroll screen sample code


As follows:

<html>
<head>
<script language="javascript" type="text/javascript">
//Double-click to scroll through the code on the screen
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; // stop
document.ondblclick=initialize; // start
</script>
</head>
<body>
<%
  for i=1 to 100
%>
<p> Double-click the screen to scroll Js code </p>
<%
  next
%>
</body>
</html>