2
我在使用colorbox时遇到了问题。我想通过colorbox在WP中打开附件页面。该页面具有多个不同尺寸的图像(横向&纵向),因此彩盒的宽度和高度必须灵活。使用默认的dataType正在工作,但是当我第二次点击图像时,似乎最后一个colorbox没有正确关闭。因此它有两个colorbox运行。每次单击图像时,colorbox都会进行乘法运算。任何想法如何解决这个问题?谢谢。Colorbox打开两倍/乘法
<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>