无法将Bootstrap弹出模式设置为仅出现一次

时间:2018-09-02 02:48:16

标签: javascript jquery html popup

我使用了引导程序弹出模式,但是每次页面加载时都会出现。我遍历了Stackoverflow中的每个问题和答案,并尝试了所有代码,但是没有用。这就是为什么我再次发布此问题。我对Javascript不太熟悉,因此我要求为我发布正确的代码。我使用的代码如下:

<script>
jQuery(window).load(function(){
   setTimeout(function(){
       jQuery('#myModal2').modal('show');      
   }, 10000);
});
</script>
<div id="myModal2" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title" style="font-size:18px; text-align:center;">Get The Latest & Best Coupon/Offer Alerts</h4>
            </div>
            <div class="modal-body">
				<h4 style="font-size:16px; text-align:center;">Subscribe to our mailing list to get the latest updates straight in your inbox.</h4>
				<hr>
                <center><?php echo do_shortcode('[newsletter_form type="minimal"]'); ?></center>
                <br>
                <h3 class="cb-subnl">We value your privacy & guarantee zero spamming. Subscribe now and receive 1 mail per day. Never miss out on latest coupons, deals and best offers!</h3>
            </div>
        </div>
    </div>
</div>

0 个答案:

没有答案