Javascript 单击外部弹出窗口时,放大模式关闭

Javascript 单击外部弹出窗口时,放大模式关闭,javascript,magnific-popup,Javascript,Magnific Popup,单击关闭弹出窗口时,放大弹出窗口关闭,模式设置为true $(document).ready(function() { $.magnificPopup.open({ items: { src: '<div class="white-popup">Our terms and conditions have changed. Please review them: <p><br><a class="popup-

单击关闭弹出窗口时,放大弹出窗口关闭,模式设置为true

      $(document).ready(function() {
    $.magnificPopup.open({
      items: {
        src: '<div class="white-popup">Our terms and conditions have changed. Please review them: <p><br><a class="popup-modal-dismiss" href="#">Got it</a></p></div>',
        type: 'inline',
        preloader: false,
        modal: true
      }
    });
    $(document).on('click', '.popup-modal-dismiss', function(e) {
      e.preventDefault();
      $.magnificPopup.close();
    });   
  });
$(文档).ready(函数(){
$.magnificPopup.open({
项目:{
src:“我们的条款和条件已更改。请查看它们:

”, 键入:“内联”, 预加载程序:false, 莫代尔:对 } }); $(文档)。在('单击','上。弹出'功能(e){ e、 预防默认值(); $.magnificPopup.close(); }); });


报告了一个类似的问题,但我在笔中使用的是最新版本

您犯了一个小错误,配置不应该在
项{…}

$(document).ready(function() {
  $.magnificPopup.open({
    items: {
      src: '<div class="white-popup">Our terms and conditions have changed. Please review them: <p><br><a class="popup-modal-dismiss" href="#">Got it</a></p></div>',
      type: 'inline',
    },
    modal: true,
    preloader: false,
  });

});
$(文档).ready(函数(){
$.magnificPopup.open({
项目:{
src:“我们的条款和条件已更改。请查看它们:

”, 键入:“内联”, }, 莫代尔:是的, 预加载程序:false, }); });

这是更新后的代码笔:

您犯了一个小错误,配置不应该在
项{…}

$(document).ready(function() {
  $.magnificPopup.open({
    items: {
      src: '<div class="white-popup">Our terms and conditions have changed. Please review them: <p><br><a class="popup-modal-dismiss" href="#">Got it</a></p></div>',
      type: 'inline',
    },
    modal: true,
    preloader: false,
  });

});
$(文档).ready(函数(){
$.magnificPopup.open({
项目:{
src:“我们的条款和条件已更改。请查看它们:

”, 键入:“内联”, }, 莫代尔:是的, 预加载程序:false, }); });
以下是更新后的代码笔: