获得“无法加载所请求的内容".带有花哨的盒子(虽然控制台中没有错误) [英] Getting a "The requested content cannot be loaded" with fancy box (no errors in console though)

查看:87
本文介绍了获得“无法加载所请求的内容".带有花哨的盒子(虽然控制台中没有错误)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用fancybox弹出一个简单的vimeo: http://fancyapps.com/fancybox/

I'm using fancybox to have a simple vimeo popup: http://fancyapps.com/fancybox/

这是我的jQuery:

Here's my jQuery:

$(".fancybox").fancybox({
    openEffect: 'none',
    closeEffect: 'none',
    padding: 0
});

这是我的HTML:

<a class="fancybox" href="http://vimeo.com/5319920">
    <img class="video_preview" src="/assets/home/video_preview.png">
</a>

问题是我收到一个The requested content cannot be loaded错误,但未记录任何错误.显然,脚本正在被调用.

The issue is that I get a The requested content cannot be loaded error without any logged errors. Clearly the script is getting called.

这里可能发生什么,有什么想法吗?我完全不知所措.

What might be happening here, any ideas? I'm at a complete loss.

谢谢!

推荐答案

您只需要再做两件事:

1).添加fancybox-media helper js文件,例如(检查您自己的路径):

1). add the fancybox-media helper js file like (check your own path):

<script type="text/javascript" src="{your_path}/helpers/jquery.fancybox-media.js"></script>

2).在您的脚本中添加助手媒体选项:

2). add the helpers media option to your script:

$(".fancybox").fancybox({
    openEffect: 'none',
    closeEffect: 'none',
    padding: 0, //<-- notice I added a comma here ;)
    helpers : {
     media : {}
    }
});

这篇关于获得“无法加载所请求的内容".带有花哨的盒子(虽然控制台中没有错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆