点击按钮进入一个新的页面

<html> 

 <head> 

 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 

 <title>sharejs.com 鼠标滑过按钮变色</title> 

 <style> 

 body{background-color:151E23} 

 #divIndexTop{width:100%;height:40px; position:absolute;} 

 .btnTop{border-width:0px;width:80px;height:25px; margin:0px; padding:0px;color:#666666;} 

 .btnTopOut{border-width:0px;width:80px;height:25px;margin:0px; padding:0px;} 

 .btnTopOver{border-width:0px;width:80px;height:25px;margin:0px; padding:0px;cursor:hand;font-weight:bold; background-color:#FFFFFF;} 

 </style> 

 </head> 

   

 <body> 

 <div id="divIndexTop" style="text-align:center; z-index:-1"> 

 <input type="button" class="btnTop" value="首页" onclick="check()"> 

 <input type="button" class="btnTop" value="商品展示"> 

 <input type="button" class="btnTop" value="站内新闻"> 

 <input type="button" class="btnTop" value="在线聊天"> 

 <input type="button" class="btnTop" value="留言簿"> 

 <input type="button" class="btnTop" value="后台管理"> 

 </div> 

 <script>         function check(){  javascript:document.location.href='http://127.0.0.1:8080/test1.jsp' }      //触发onMouseOver事件时 

     for(var i=0;i<btns.length;i++){ 

     btns[i].onmouseover=function () 

     { 

         this.className="btnTopOver"; 

         this.style.color="#000000"; 

     }; 

     //触发onMouseOut事件时 

     btns[i].onmouseout=function ()       { 

         this.className="btnTopOut"; 

         this.style.color="#666666"; 

     }; 

     } 

 </script> 

 </body> 

</html>

posted @ 2013-03-02 20:49  SA高处不胜寒  阅读(1166)  评论(0编辑  收藏  举报