点击弹窗提示,3秒后关闭窗口并跳转新开窗口

简介: 点击弹窗提示,3秒后关闭窗口并跳转新开窗口

点击弹窗提示,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('新窗口无法打开,请检查你的浏览器设置。')
        }       
        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>
目录
相关文章
|
1月前
解决点击button按钮会刷新页面的问题
解决点击button按钮会刷新页面的问题
28 0
|
7月前
|
小程序 前端开发 JavaScript
小程序点击按钮出现和隐藏遮罩层
小程序点击按钮出现和隐藏遮罩层
171 0
|
7月前
|
小程序 JavaScript
小程序点击按钮弹出可填写框
小程序点击按钮弹出可填写框
78 0
|
7月前
点击按钮,新增输入框,再点击按钮,删除输入框
点击按钮,新增输入框,再点击按钮,删除输入框
33 0
|
7月前
|
小程序 开发者
小程序中点击按钮跳转另外一个小程序
小程序中点击按钮跳转另外一个小程序
258 0
|
11月前
|
存储
selenium+python:点击元素、alert弹框、鼠标操作(左键点击、右键点击、双击、鼠标悬浮)、下拉选项框、窗口切换等操作的处
selenium+python:点击元素、alert弹框、鼠标操作(左键点击、右键点击、双击、鼠标悬浮)、下拉选项框、窗口切换等操作的处
|
XML 数据格式
AS中按钮不显示问题
AS中按钮不显示问题
QT 点击关闭按钮时提示是否退出同时按钮显示为中文
QT 点击关闭按钮时提示是否退出同时按钮显示为中文
QT 点击关闭按钮时提示是否退出同时按钮显示为中文