ColorBox 的幻灯片在关闭后关闭

ColorBox's slideshow turns off after closing

本文关键字:幻灯片 ColorBox      更新时间:2023-09-26

我想为我的网站使用 ColorBox。我使用了以下代码:

$('a.gal').each(function() {
    $(this).colorbox({
        rel:'g',
        slideshow: true,
        scrolling: false,
        slideshowAuto: false,
        returnFocus: false
    });
});

我的问题是 - 当我第一次点击图像时,幻灯片可以工作。但是当我关闭它然后重新打开它时,幻灯片按钮丢失了。可能是什么原因造成的?

jsFiddle: http://jsfiddle.net/37365/

好的,我想我已经弄清楚了问题所在。这与 placehold.it 图像有关。当我在本地或从其他 URL 加载图像时,幻灯片工作正常。

<a href="your_image_location" class="gal"><img src="http://www.placehold.it/350x150.jpg" class="attachment-full">

JSFIDDLE: http://jsfiddle.net/

如果它仍然不适合您,请检查 head 标记内部以查看您是否包含所有必要的脚本:

<script src="http://code.jquery.com/jquery-2.0.2.js" type="text/javascript">
<script src="http://code.jquery.com/jquery-migrate-1.2.1.js" type="text/javascript">
<script src="http://www.jacklmoore.com/colorbox/jquery.colorbox.js" type="text/javascript">