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

📄 8-8 动态提示窗口.htm

📁 JAVASCRIPT完全自学手册,中源码的验证修订实例
💻 HTM
字号:
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GB2312" />
<title>8-8  动态提示窗口</title>
<!-- 样式表 -->
<style>
* { font-size:12px; font-family:宋体, Arial; font-weight:normal; color:#333; } /*规定了所有的字体样式*/
</style>
<script>
var oPopup;
var winWidth = 220, winHeight = 140;
var popup_dir;

function initPopup(){
    oPopup = window.open("","_popup","scrollbars=no, status=no, toolbar=no, menubar=no, resizable=no, titlebar=no, location=no");
    var oBody = oPopup.document.body;
    oBody.style.backgroundColor = "lightyellow";
    oBody.style.borderStyle = "none";
}
function showInfo(str){
    initPopup();
    oPopup.document.body.innerHTML = str;
    popup_dir = -1;
    showPopup(winHeight-100);
}
function showPopup(y){
    oPopup.resizeTo(winWidth, winHeight - y);
    oPopup.moveTo(screen.availWidth - winWidth, screen.availHeight - winHeight + y);
    y+=popup_dir;
    if(y>winHeight-100 && popup_dir>0){
        oPopup.close();
        return;
    }else if(y<0 && popup_dir<0){
        popup_dir = 2;
        setTimeout("showPopup(0);",2000);
        return;
    }else{
        setTimeout("showPopup(" + y + ");", 2);
    }
}
</script>
</head>
<body style="overflow:auto;">
<input type="button" value="测试提示效果" onclick="showInfo('这里是提示信息');">
</body>
</html>

⌨️ 快捷键说明

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