我想扩展"next“按钮和"prev”按钮的Lightbox图库。请帮帮我!
清单:
<?php
$result = mysql_query("SELECT * FROM uploads WHERE gal='$gallery' ORDER BY id ASC");
while ($galrow = mysql_fetch_array($result)) {
?>
<a href="javascript:void(0);" onclick="document.getElementById('underlay').style.display='block'; document.getElementById('lightbox').style.display='block'; document.getElementById('lightbox-img').src = 'gal/<?php echo $gallery . '/' . $galrow ['image']; ?>';">
<?php
echo '<img src="gal/' . $gallery . '/' . $galrow['image'] . '" />';
?>
</a>
<?php
}
?>显示:
<div id="underlay">
</div>
<div id="lightbox">
<img src="" alt="" id="lightbox-img"/>
<a href="javascript:void(0);" onclick="document.getElementById('underlay').style.display='none'; document.getElementById('lightbox').style.display='none';">X</a>
<a href="?">Next button</a>
<a href="?">Prev button</a>
</div>发布于 2013-11-21 07:29:14
我自己从来没试过,但我相信。最简单的方法是使用CSS将原始的next和previous按钮移动到您想要的位置。那就改变它的外观就行了。
在如何做到这一点上,这里看起来是一个很好的开端:http://answers.squarespace.com/questions/4375/how-can-i-customize-the-next-and-previous-buttons-in-the-lightbox-gallery-mode
https://stackoverflow.com/questions/20114866
复制相似问题