Начало
Навигация
Быстрый переход Фразы
Позволяет пользователю быстро переходить на сайт по своему выбору, введя короткую фразу для этого сайта.
JavaScript Navigation: Быстрый переход Фразы
<!-- THREE STEPS TO INSTALL QUICK JUMP PHRASES: 1. Add the first code into the BODY of your opening page (index.html) 2. Copy the next coding into the HEAD of your popup page (demo.html) 3. Paste the last code into the BODY of the popup page --> <!-- STEP ONE: Paste this code into the HEAD of your HTML document --> <HEAD> <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['a'] = "http://javascriptlist.narod.ru"; name['a'] = "Acadiana Now/<I>javascriptlist.narod.ru</I>"; key['br'] = "http://www."; name['br'] = "ссылка"; key['bt'] = "http://www."; name['bt'] = "ссылка"; key['c'] = "http://www."; name['c'] = "ссылка"; key['d'] = "http://www."; name['d'] = "ссылка"; key['gr'] = "http://www."; name['gr'] = "ссылка"; key['go'] = "http://www."; name['go'] = "ссылка"; key['in'] = "http://"; name['in'] = "ссылка"; key['jd'] = "http://"; name['jd'] = "ссылка"; key['jg'] = "http://"; name['jg'] = "ссылка"; key['jr'] = "http://"; name['jr'] = "ссылка"; key['js'] = "http://"; name['js'] = "ссылка"; key['k'] = "http://www."; name['k'] = "ссылка"; key['ly'] = "http://www."; name['ly'] = "ссылка"; key['l4'] = "http://www."; name['l4'] = "ссылка"; key['ms'] = "http://www.microsoft.com"; name['ms'] = "Microsoft"; key['p'] = "http://www."; name['p'] = "ссылка"; key['q'] = "http://www."; name['q'] = "ссылка"; key['rc'] = "http://www."; name['rc'] = "ссылка"; key['rr'] = "http://www."; name['rr'] = "ссылка"; key['st'] = "http://"; name['st'] = "ссылка"; key['tb'] = "http://www."; name['tb'] = "ссылка"; key['ul'] = "http://www."; name['ul'] = "ссылка"; key['ur'] = "http://www"; name['ur'] = "ссылка"; key['v'] = "http://"; name['v'] = "ссылка"; key['w'] = "http://"; name['w'] = "ссылка"; key['y/'] = "http://www.yahoo.com"; name['y/'] = "ссылка"; key['yl'] = "http://"; name['yl'] = "ссылка"; key['ym'] = "http://"; name['ym'] = "ссылка"; key['yn'] = "http://"; name['yn'] = "ссылка"; key['yv'] = "http://"; name['yv'] = "ссылка"; key['z'] = "http://"; name['z'] = "ссылка"; 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[i]; 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> </HEAD> <!-- STEP TWO: Copy this code into the BODY of your opening HTML document --> <BODY> <center> <form name="openpage"> <input type=button value="Open Quick Jump Page" onClick="window.open('quick-jump-phrases-demo.html');"> </form> <!-- STEP THREE: Copy this code into the BODY of your popup HTML document --> <center> <table align="right" bgcolor="#eeeeee"> <tr><td colspan=3><font face="Arial"><b>Jump Keys</b> - Enter any key sequence to jump to the page.</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[i] + ">" + name[i] + "</A></TD></TR>"; document.write (dispstring); balanceCounter++; if (balanceCounter == balanceFactor) { document.write ("</TABLE></TD><TD><TABLE>"); balanceCounter = 0; } } // End --> </SCRIPT> </table> </td> </tr> </table> </center> <!-- Script Size: 4.91 KB -->