跟随鼠标的十字线代码

个人觉得这段代码如果配合现在比较流行的“百万格子”代码一起使用肯定很方便!

XML/HTML代码
  1. <html>  
  2. <title>跟随鼠标的十字线</title>  
  3. <head>  
  4. <meta name="keywords" content="51windows.Net">  
  5. <meta http-equiv=Content-Type content="text/html; charset=gb2312">  
  6. </head>  
  7. <body>  
  8. <script language="JavaScript">  
  9. <!–   
  10. var jsstr = ""  
  11. + "<img src=\"about:blank\" id=\"leftright\" style=\"width:e­xpression(document.body.clientWidth);height:1px;position:absolute;left:0;top:0;background-color:#6699cc;z-index:100;\" \/>\n"   
  12. + "<img src=\"about:blank\" id=\"topdown\" style=\"height:e­xpression(document.body.clientHeight);width:1px;position:absolute;left:0;top:0;background-color:#6699cc;z-index:100;\" \/>\n"   
  13. document.writeln(jsstr);   
  14.   
  15. function followmouse(){   
  16.     leftright.style.top = window.event.y-2   
  17.     topdown.style.left = window.event.x-2   
  18. }   
  19. document.onmousemove=followmouse  
  20. //–>  
  21. </script>  
  22. </body>  
  23. </html>  
武汉商顺工商事务代理有限公司

说说你的看法