⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 8-5 模拟windows帮助效果.htm

📁 JAVASCRIPT完全自学手册,中源码的验证修订实例
💻 HTM
字号:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312" />
<title>8-5  模拟Windows帮助效果</title>
<!-- 样式表 -->
<style>
* { font-size:12px; font-family:宋体, Arial; font-weight:normal; color:#333; } /*规定了所有的字体样式*/
</style>
<script>
var oPopup = window.createPopup();
function prepareHelp(){
    document.styleSheets[0].rules[0].style.cursor = "help";
}

function do_onclick(){
    if(document.styleSheets[0].rules[0].style.cursor != "help"){
        //不是帮助状态下,执行原本定义的操作
        alert("我被鼠标单击了!");
    }else{
        var oBody = oPopup.document.body;
        oBody.style.backgroundColor = "lightyellow";
        oBody.style.border = "solid black 1px";
        oBody.innerHTML = "本按钮的功能是弹出一个提示信息。".fontcolor("blue").bold() + "<br><small>弹出一个提示在<B>弹出式窗体</B>外单击鼠标以关闭本窗体。</small>";
        oPopup.show(event.x+15, event.y+15, 180, 85, document.body);
        document.styleSheets[0].rules[0].style.cursor = "";
    }
}

</script>
</head>
<body style="overflow:auto;">
<input  type="button" value="?" onclick="prepareHelp();" />
<input type="button" value="点我" onclick="do_onclick()" />
</body>
</html>

⌨️ 快捷键说明

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