Fancybox无法加载请求的内容.请稍后再试 [英] Fancybox The requested content cannot be loaded. Please try again later
本文介绍了Fancybox无法加载请求的内容.请稍后再试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<link rel="stylesheet" href="<?php echo $this->getSkinUrl(''); ?>js/fancybox/source/jquery.fancybox.css?v=2.0.6" type="text/css" media="screen" />
<script type="text/javascript" src="<?php echo $this->getSkinUrl(''); ?>js/fancybox/source/jquery.fancybox.pack.js?v=2.0.6"></script>
<script type="text/javascript">
$(document).ready(function() {
$("a#image").fancybox();
$("a#image").trigger('click');
$("a#image").hide();
});
<a id="image" href="banner-about-cart.png"><img src="<?php echo $this->getSkinUrl() ?>images/banner-about-cart.png" alt=""/></a>
有什么想法吗?我在没有精美插件的情况下进行了图片加载测试,可以在网站上看到图片,我也在使用magento.
Any ideas? The image loading I test without fancy plugin I can see image in site, I am using magento as well.
推荐答案
我认为您应该内联指定fancybox类, 请记住,css文件中也包含样式代码:
I think you should specify the fancybox class inline, remember that there are styling code in the css file as well:
<a id="image" href="banner-about-cart.png" class="fancybox">
<img src="<?php echo $this->getSkinUrl(); ?>images/banner-about-cart.png" alt="" />
</a>
<!--notice that you forgot to semi-colon after $this->getSkinUrl() -->
<script>
$(document).ready(function() {
$("a#image").fancybox();
//try wrapping the rest of the code in this document load:
$(document).load(function(){
$("a#image").trigger('click');
$("a#image").hide();
});
});
</script>
还有,如果您尝试以下方法之一会发生什么?:
also, what happens If you try one of the following?:
$('#image').trigger('click');
//or
$('a[id="image"]').trigger('click');
//?
这篇关于Fancybox无法加载请求的内容.请稍后再试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文