您可以通过单击单个图像使用prettyPhoto打开图像库吗?

时间:2015-01-06 17:27:09

标签: jquery image-gallery prettyphoto

点击单张图片后,我正在尝试利用prettyPhoto打开图库。

在他们的演示页面上,我可以看到如何通过拥有一堆图像来实现这一目标:

<a href="images/fullscreen/1.jpg" rel="prettyPhoto[pp_gal]" title="You can add caption to pictures."><img src="images/thumbnails/t_1.jpg" width="60" height="60" alt="Red round shape" /></a>
<a href="images/fullscreen/2.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="Nice building" /></a>
<a href="images/fullscreen/3.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_3.jpg" width="60" height="60" alt="Fire!" /></a>
<a href="images/fullscreen/4.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_4.jpg" width="60" height="60" alt="Rock climbing" /></a>
<a href="images/fullscreen/5.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_5.jpg" width="60" height="60" alt="Fly kite, fly!" /></a>

但我确实要将其设为相册样式,这意味着一旦您点击一张图片,其他图片就会显示在prettyPhoto弹出窗口中。

2 个答案:

答案 0 :(得分:0)

是的!我认为这不是一个正确的方法,但这将有所帮助。将除专辑封面之外的其他图像放在另一个div中,并将其显示为无css。

<a href="images/fullscreen/1.jpg" rel="prettyPhoto[pp_gal]" title="You can add caption to pictures."><img src="images/thumbnails/t_1.jpg" width="60" height="60" alt="Red round shape" /></a>
<div style="display:none;">
<a href="images/fullscreen/2.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_2.jpg" width="60" height="60" alt="Nice building" /></a>
<a href="images/fullscreen/3.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_3.jpg" width="60" height="60" alt="Fire!" /></a>
<a href="images/fullscreen/4.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_4.jpg" width="60" height="60" alt="Rock climbing" /></a>
<a href="images/fullscreen/5.jpg" rel="prettyPhoto[pp_gal]"><img src="images/thumbnails/t_5.jpg" width="60" height="60" alt="Fly kite, fly!" /></a>
</div>    

答案 1 :(得分:0)

我这样做是为了在我的网站中解决这个问题

<a href="Images/1.jpg" rel="prettyPhoto[pp_gal]">
    <img src="Images/2.jpg" />
</a>

并且对于另一个图像只需写一个标签并将Rel设置为Rel Like this This

<a href="Images/3.jpg" rel="prettyPhoto[pp_gal]"></a>
<a href="Images/4.jpg" rel="prettyPhoto[pp_gal]"></a> 
<a href="Images/5.jpg" rel="prettyPhoto[pp_gal]"></a>