繁体   English   中英

弹出框自动关闭

[英]Pop Up Box Automatic Closing

我需要在3秒内自动关闭弹出框。

请帮帮我们

HTML:

<div align="center">
<!--Validation Dialogue box popup-->
<div id="blanket" style="display:none;"></div>
<div id="validationPopup" style="display:none;">
</br>

<div id="validationMessage" align="center"></div>
</div>

<form id="Reject118" name="Reject118" method="post" action="#" onsubmit="return reject_validation(this.name);">
        <input type="submit" class="Reject" name="Reject" id="Reject" value="Reject" title="Click here to Reject this product item & send back for Moderator's Review" />
        <br />
        <textarea name="reject_reason" id="reject_reason" rows="3" cols="9" onblur="if(this.value == '')
{ this.value = 'Type Reject Reason Here';
this.style.color = '#8f8484';}" onfocus="if(this.value == 'Type Reject Reason Here'){ this.value = ''; this.style.color = '#8f8484';}" style="color:#8f8484;">Type Reject Reason Here</textarea>
</form>

我的FIDDLE

小提琴

我猜getElementById是弹出元素,在这种情况下,下面的JS应该工作:

setTimeout(function(){
   document.getElementById('validationPopup').style.display='none';
},3000)
function Hidepopup() {
            document.getElementById('validationPopup').style.display = "none";
        }
        setTimeout("Hidepopup();", 3000);

请添加以下代码

function hideautomatic {
  setTimeout(function () {

    setTimeout(function () {
        $("#yourpop").hide();

    }, 3000);
}, 1000);
};

只需添加:

window.setTimeout(function() {
    toggle('blanket');
    toggle(windowname);
}, 3000);

你的弹出方法,这是你的小提琴

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM