【问题标题】:Colorbox Crashing When Viewed As Mobile App当作为移动应用程序查看时,Colorbox 崩溃
【发布时间】:2013-05-08 03:11:01
【问题描述】:

我已经在我的移动网站上安装并配置了 Drupal 的 Colorbox 模块。一切正常,除非用户从 iPhone 的主屏幕打开网站。颜色框短暂打开,然后关闭。当用户在其 iPhone 上的 Safari 浏览器上查看网站的移动版本时,不会发生这种情况。只有在他们将其添加到主屏幕并通过它查看后才会发生。

【问题讨论】:

    标签: iphone mobile colorbox


    【解决方案1】:

    原来是以下脚本导致了错误。此脚本可防止在 Mobile Safari 中打开链接。 https://gist.github.com/1042026

    <script>(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone")</script>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-20
      • 1970-01-01
      • 2019-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多