跳转到页顶或则页底

<HTML>
<HEAD>
<TITLE>测试<TITLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
function Skip(str){
   if('down'==str){
      document.body.scrollTop=document.body.scrollHeight;//跳到网页尾部
   }else{
      document.body.scrollTop=0;//跳到网页尾部
   }
}
//-->
</SCRIPT>
</HEAD>
<BODY >
<INPUT TYPE="submit" value="跳到页底" onClick="Skip('down');" >
<table width="200" border="1">
  <tr height="3000">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<INPUT TYPE="submit" value="跳到页头"  onClick="Skip('up');">
</BODY>
</HTML>
posted on 2010-03-26 09:14  visoeclipse->jor  阅读(612)  评论(0编辑  收藏  举报