• 点击弹窗提示,3秒后关闭窗口并跳转新的页面


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <title>Document</title>
    <script type="text/javascript" src="jquery-1.8.3.min.js"></script>
    
    <style type="text/css" >
    /*灰色遮罩层*/
    .fade{
    width:100%;
    height:100%;
    background:rgba(0, 0, 0, 0.5);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 99;
    }
    /*弹出层*/ 
    .succ-pop{
    width: 400px;
    height: 300px;
    background: #fff;
    position: fixed;
    left: 50%;
    top: 50%;
    margin-left: -200px;
    margin-top: -150px;
    z-index: 999;
    border-radius: 5px;
    } 
    .succ-pop h3.title{
    text-align: center;
    font-size: 22px;
    color: #ce002c;
    }
    
    </style>
    <script>
    function showDiv(){
    $("#fade").show();
    $("#pop").show();
    setTimeout(function(){
    //var windowOpen = window.open("http://www.baidu.com");
    //if (windowOpen == null || typeof(windowOpen)=='undefined'){
    //$('#feedback').html('新窗口无法打开,请检查你的浏览器设置。')
    window.location.href="http://www.baidu.com";
    }    
    hideDiv();
    }, 3000);
    }
    function hideDiv(){
    $("#fade").hide();
    $("#pop").hide();
    }
    </script>
    </head>
    <body>
    
    <div class="fade" id="fade" style="display:none"></div>
    <div class="succ-pop" id="pop" style="display:none">
    <h3 class="title">
    提示文字
    </h3>    
    </div>
    
    <input id="show" type="button" readonly="readonly" value="点击显示" onclick="showDiv()"/>
    
    </body>
    </html>
      
    View Code
  • 相关阅读:
    iOS No such file or directory
    获取图片某点或区域的颜色
    GCD 异步分组执行
    FMDB
    键盘样式风格有关设置
    libc++abi.dylib handler threw exception
    苹果Xcode帮助文档阅读指南2
    面试集锦-常量,const, const 对指针的影响
    支付宝遇到的坑和解决方案
    闲谈
  • 原文地址:https://www.cnblogs.com/peteremperor/p/9953488.html
Copyright © 2020-2023  润新知