我在使用colorbox时遇到了问题。我想打开可湿性粉剂通过颜色盒的附件页面。页面有几个不同大小的图像(横向和纵向),因此颜色盒的宽度和高度必须灵活。使用默认的dataType是可行的,但当我第二次点击图像时,似乎最后一个颜色盒没有正确关闭。因此,它有两个运行的颜色盒。每次我单击图像时,颜色盒都会进行乘法运算。你知道怎么解决这个问题吗?谢谢。
<script>
$(document).ready(function(){
$('.lightbox').colorbox();
});
</script>
<div class='image-wrap'>
<dl class='gallery-item'>
<dt class='gallery-icon'>
<a class="lightbox" href='http://localhost/Maize/?attachment_id=122' title='8'>
<img width="250" height="190" src="http://localhost/Maize/wp-content/uploads/2013/04/8-250x190.jpg" class="attachment-thumbnail" alt="8" />
</a>
</dt>
</dl>
<dl class='gallery-item'>
<dt class='gallery-icon'>
<a class="lightbox" href='http://localhost/Maize/home/home-page/attachment/7/' title='7'>
<img width="250" height="190" src="http://localhost/Maize/wp-content/uploads/2013/04/7-250x190.jpg" class="attachment-thumbnail" alt="7" />
</a>
</dt>
</dl>
</div>发布于 2013-07-16 17:09:14
在打开新的颜色盒之前,是否要关闭以前的颜色盒?如果没有,当您想要关闭第一个lightbox时,您可以尝试调用$.colorbox.close();。
https://stackoverflow.com/questions/16169265
复制相似问题