0090.htm

来自「新时代软件教程:操作系统 主页制作 服务器 设计软件 网络技术 编程语言 文字编」· HTM 代码 · 共 46 行

HTM
46
字号
<html>

<head>
<title>新时代软件教程:操作系统 主页制作 服务器 设计软件 网络技术 编程语言 文字编辑</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
<!--
body, table {font-size: 9pt; font-family: 宋体}
a {text-decoration:none}
a:hover {color: red;text-decoration:underline}
.1  {background-color: rgb(245,245,245)}
-->
</style>
</head>
<p align="center"><script src="../../1.js"></script></a>
    <p align="center"><big><strong>给页面定义热键</strong></big></p>

<div align="right">---摘自互联网</div>

                <p><font color="#000000">把下面代码copy入你html文件的&lt;head&gt;和&lt;/head&gt;中再按一下b键试试:</font></p>
                <p>&lt;script&gt;<br>
                var travel=true<br>
                var hotkey=98 /* hotkey即为热键的键值,是ASII码,这里98代表b键 
                */<br>
                var destination=&quot;../index.htm&quot; /* 
                在此定义热键对应的页面 */<br>
                if (document.layers)<br>
                document.captureEvents(Event.KEYPRESS)<br>
                function gogo(e){<br>
                if (document.layers){<br>
                if (e.which==hotkey&amp;&amp;travel)<br>
                window.location=destination<br>
                }<br>
                else if (document.all){<br>
                if (event.keyCode==hotkey)<br>
                window.location=destination<br>
                }<br>
                }<br>
                document.onkeypress=gogo<br>
                &lt;/script&gt;

  </table>
<p align="center"><script src="../../2.js"></script></a>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?