3.20.06跟随鼠标的十字线代码
个人觉得这段代码如果配合现在比较流行的“百万格子”代码一起使用肯定很方便!
XML/HTML代码
- <html>
- <title>跟随鼠标的十字线</title>
- <head>
- <meta name="keywords" content="51windows.Net">
- <meta http-equiv=Content-Type content="text/html; charset=gb2312">
- </head>
- <body>
- <script language="JavaScript">
- <!–
- var jsstr = ""
- + "<img src=\"about:blank\" id=\"leftright\" style=\"width:expression(document.body.clientWidth);height:1px;position:absolute;left:0;top:0;background-color:#6699cc;z-index:100;\" \/>\n"
- + "<img src=\"about:blank\" id=\"topdown\" style=\"height:expression(document.body.clientHeight);width:1px;position:absolute;left:0;top:0;background-color:#6699cc;z-index:100;\" \/>\n"
- document.writeln(jsstr);
- function followmouse(){
- leftright.style.top = window.event.y-2
- topdown.style.left = window.event.x-2
- }
- document.onmousemove=followmouse
- //–>
- </script>
- </body>
- </html>

说说你的看法