简体   繁体   English

Magnific Popup无法在手机上使用

[英]Magnific Popup not working on mobile

Magnific popup seems to be working fine on desktop AND even Android phone but on an iPhone it shows the messsage "A problem occurred with this webpage so it was reloaded" and doesn't play the Vimeo video. 宏大的弹出窗口似乎在台式机甚至Android手机上都可以正常工作,但在iPhone上却显示消息“此网页出现问题,因此重新加载” ,并且无法播放Vimeo视频。

update: Just tried it on Chrome on my iPhone and it works fine. 更新:刚刚在我的iPhone上的Chrome上尝试过,并且效果很好。 Looks like it's just Safari? 看起来只是Safari吗?

This is the HTML code: 这是HTML代码:

<ul id="page1-slider7" class="bxslider">
    <li>
        <div class="c c1"><a href="http://vimeo.com/80951188" target="_blank" class="portfolio-link video">Watch Video</a><img src="images/sidecar/video/SmuinXXmas.jpg" /></div>
    </li>
    <li>
        <div class="c c2"><a href="http://vimeo.com/119386830" target="_blank" class="portfolio-link video">Watch Video</a><img src="images/sidecar/video/SunrunBrilliant.jpg" /></div>
    </li>
    <li>
        <div class="c c3"><a href="http://vimeo.com/151719496" target="_blank" class="portfolio-link video">Watch Video</a><img src="images/sidecar/video/PIER_BOGO_Video.jpg" /></div>
    </li>
</ul>

The js file js文件

var initPopup = function(){
    $('.portfolio-link.video').magnificPopup({
        disableOn: 400,
        type: 'iframe',
        mainClass: 'mfp-fade',
        removalDelay: 160,
        preloader: false,
        fixedContentPos: true
    });
}

Anyone have this issue? 有人遇到这个问题吗? Thanks in advance! 提前致谢!

Remove this attributes "disableOn: 400" 删除此属性“ disableOn:400”

Keep only below code. 仅保留下面的代码。

jQuery('.portfolio-link.video').magnificPopup({
    type: 'iframe',
    mainClass: 'mfp-fade',
    removalDelay: 160,
    preloader: false,
    fixedContentPos: true
});

I have faced same issue like you. 我曾经遇到过像您一样的问题。 I think issue is not in coding. 我认为问题不在编码中。

There are lots of reason for facing such type of issue. 面对此类问题有很多原因。

Try to follow below Procedure. 尝试遵循以下步骤。 Trial 1) 试用1)

1-Close all open apps by double pressing the Home button then swipe up on all open apps.

2-Clear your browser’s history and web site data by going to Settings > Safari > Clear History and Website Data.

3-Restart your device.

4-Reset your iPad or iPhone by  pressing and holding the Sleep/Wake and Home buttons at the same time for about 5-10 seconds until you see the Apple logo.

Trial 2) 试用2)

Method 1: Resetting Network Setting. 方法1:重置网络设置。

Most of the time there is a network issue so we will start with Resetting network settings. 大多数情况下,存在网络问题,因此我们将从重置网络设置开始。 So to do so, Just Navigate to Settings > General > Reset Network Settings. 为此,只需导航至“设置”>“常规”>“重置网络设置”。

Method 2: Clear Browser Cache & History. 方法2:清除浏览器缓存和历史记录。

If you figure out that Your network is not the issue, then your next step is to fix issues with your browser. 如果确定不是您的网络问题,那么下一步就是修复浏览器问题。 So better you Clear your Browser Cache & History. 因此,最好清除您的浏览器缓存和历史记录。

In Safari go to Settings > Safari > Clear Website Data. 在Safari中,转到设置> Safari>清除网站数据。 Now close the Browser and restart it to check whether the error still persists. 现在关闭浏览器并重新启动,以检查错误是否仍然存在。

Tip: Close all the unused tabs in your browser. 提示:关闭浏览器中所有未使用的标签。

Method 3: Resetting your iPAD 方法3:重置您的iPAD

Most of the time 2 methods mentioned above should work to Fix A Problem Occurred with this Webpage so it was Reloaded error but if you still can't get rid of it, then You need to Reset your iPad. 上面提到的大多数时间2种方法都应该可以解决此网页上出现的问题,因此它是“重新加载”错误,但是如果仍然无法摆脱它,那么您需要重置iPad。

Press and keep holding Home and Sleep Button for about 15 Seconds. 按住并保持“居家和睡眠”按钮约15秒钟。 Let it Reboot on its own. 让它自行重启。 This should fix any further issues. 这应该解决任何进一步的问题。 if not then Try Method 4. 如果不是,请尝试方法4。

Method 4: Reinstalling JAVA 方法4:重新安装JAVA

Finally, uninstall and then reinstall JAVA again. 最后,卸载并重新安装JAVA。 If Java is the issue then this Method will fix this error for you. 如果是Java问题,则此方法将为您解决此错误。

And 3 rd try) 和第三次尝试)

Read the solution in Apple's Forums and try Solution as said by Users in Thread. 阅读Apple论坛中的解决方案,然后尝试按Thread中的用户所说的解决方案。

A problem occurred with this web page so it was reloaded 该网页出现问题,因此已重新加载

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM