yaner
http://bbs.phpidc.com
级别: 管理员
精华:
0
发帖: 77
威望: 67 点
金钱: 516 RMB
贡献值: 0 点
在线时间:72(小时)
注册时间:2005-07-20
最后登录:2024-07-17
|
[转帖]热键跳转 - 请输入链接前面的热键
热键跳转</b> - 请输入链接前面的热键
<html>
<head> <meta name="GENERATOR" content="Microsoft FrontPage 5.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>请将下面的源代码插入到</title>
<!--mstheme--><link rel="stylesheet" type="text/css" href="../../_themes/mstheme30788/msth1111-106.css"><meta name="Microsoft Theme" content="mstheme30788 1111, default"> </head>
<body> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin fontFace = "<FONT SIZE=2 FACE='Arial'>"; keyBuffer = ""; var key = new Array(); // Define jump-key pages here var name = new Array(); // Define jump-key pages here key['j'] = "http://www.jgwy.net"; name['j' ] = "JGWY</I>";
key['z'] = "http://info.louisiana.edu/dept/netmon.html"; name['z'] = "Network Monitor";
function getKeySite(keyStroke) { isNetscape=(document.layers); eventChooser = (isNetscape) ? keyStroke.which : event.keyCode; which = String.fromCharCode(eventChooser).toLowerCase(); keyBuffer += which; window.status = "keyBuffer='" + keyBuffer + "'"; for (var i in key) if (keyBuffer == i) { window.location = key; keyBuffer = ""; // clear buffer } var matches = 0; var kbLength = keyBuffer.length; for (var i in key) if (keyBuffer == i.substr(0,kbLength)) matches++; if (matches == 0) { window.status = "No match on '" + keyBuffer + "'."; keyBuffer = "";// clear buffer } } document.onkeypress = getKeySite; // End --> </script> <table align="right" bgcolor="#eeeeee"> <tr><td colspan=3><font face="Arial"><b>热键跳转</b> - 请输入链接前面的热键</TD></TR> <tr valign="top"> <td><table> <SCRIPT LANGUAGE="JavaScript"> <!-- Display list of Jump Keys balanceFactor = 15; /* (name.length - name.length%3)/3 + 1; */ /* document.write ("<TR><TD>" + key.length + "</TD></TR>"); document.write ("<TR><TD>" + balanceFactor + "</TD></TR>"); */ balanceCounter = 0; for (var i in key) { dispstring = "<TR><TD>" + fontFace + i.toUpperCase() + "</TD><TD>"; dispstring += fontFace + "<A HREF=" + key + ">" + name + "</A></TD></TR>"; document.write (dispstring); balanceCounter++; if (balanceCounter == balanceFactor) { document.write ("</TABLE></TD><TD><TABLE>"); balanceCounter = 0; } } // End --> </SCRIPT> </table> </td> </tr> </table>
</body>
</html>
(c) jgwy.net
|
http://phpidc.com! http://yaner.uni.cc/site http://www.losu.net bbs.phpidc.com! www.phpidc.com
|
[楼 主]
|
Posted: 2005-08-11 22:05 |
| |