【问题标题】:How do you disable magnific popup on mobile devices?如何在移动设备上禁用放大弹出窗口?
【发布时间】:2021-04-09 22:13:33
【问题描述】:

我想禁用移动设备上的弹出窗口。我在文档中找到了这段代码,但我不明白将代码放在哪里才能工作。

disableOn: function() {
          if( $(window).width() < 600 ) {
            return false;
          }
          return true;
        }

【问题讨论】:

    标签: magnific-popup


    【解决方案1】:

    这对我有帮助。 https://dimsemenov.com/plugins/magnific-popup/documentation.html#disableon

    您可以为magnificPopup设置disableOn:属性,定义不打开弹出窗口的条件。

    $(el).magnificPopup({
            disableOn: function() {
                if( $(window).width() < 600 ) {
                    return false;
                }
                return true;
            }
        })
    

    【讨论】:

      猜你喜欢
      • 2019-08-09
      • 1970-01-01
      • 1970-01-01
      • 2014-02-07
      • 2021-07-28
      • 2023-03-13
      • 1970-01-01
      • 2018-06-23
      • 2017-12-08
      相关资源
      最近更新 更多