HTML代码
<!-- 弹窗 -->
<div class="modal fade" id="modal_20200114" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title">公告</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">×</span>
        </button>
      </div>
      <div class="modal-body">
        小闻网-xwenw.com</div>
      <div class="modal-footer">
        <button type="button" class="btn btn-primary" data-dismiss="modal" id="modal_20200114_lock">我知道了,不要再弹出</button>
      </div>
    </div>
  </div>
</div>
JS代码:(放到底部)
<script>
!function (){    
var a = $('#modal_20200114');    
var b = $('#modal_20200114_lock');    
var k = $.cookie('modal_20200114_lock');    
if(!k){
        a.modal('show');
        b.on('click', function() {
            $.cookie('modal_20200114_lock', '1');
        });
    }
}();
</script>

 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。