没有.jpg的Fancybox网址未在框中打开 [英] Fancybox urls without .jpg opens not in box

查看:89
本文介绍了没有.jpg的Fancybox网址未在框中打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里看到了类似的问题: 在包含&" 的URL上的 Fancybox扼流圈 而且我尝试了所有提供的解决方案,但没有一个起作用! 我正确地包含了所有链接,(首先是jquery链接) 我检查了一下,在文档的开头,我像这样声明了fancybox:

I have seen a similar question here : Fancybox chokes on a URL that contains "&" And I have tried all offered solutions but none of them work ! I have included correctly all links, ( the jquery link first ) I checked, and at the beginning of my document, I declared fancybox like this :

<script type="text/javascript">
 $(document).ready(function() {
$(".fancybox").fancybox({'type' : 'image'});
    openEffect  : 'none',
    closeEffect : 'none'
  });
});
</script>

我的代码是:

   echo '<a class="fancybox" rel="group1" href="square/'.$fic_serie .'">
<img src="square/'.$fic_serie .'" alt=""/></a>';

$ fic_serie是将被图像名称替换的变量

$fic_serie is the var that will get replaced by the image name

现在,我觉得什么都没用;与我所说的图像相比,这些图像太大了(在fancybox.js文件中),当我单击它们时,它们将作为链接打开,而不是在lightbox中打开.

Right now, I feel like nothing works; the images are way too big compared to how I said they should be ( in the fancybox.js file ) and when I click on them, they open as a link, not in lightbox.

我也尝试过

class='fancybox fancybox.image'

但是没有运气. 谢谢!

but without luck.... Thank you !

推荐答案

尝试此代码

<script type="text/javascript">
$(document).ready(function() {
  $(".fancybox").fancybox({
    type        : 'image',
    openEffect  : 'none',
    closeEffect : 'none'
  });
});
</script>

这篇关于没有.jpg的Fancybox网址未在框中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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