2010-08-26 32 views
0

由于某些原因,我不知道,prettyPhoto加载图像反向。它首先打开最后一张照片,然后按照您的猜测,您可以选择将上一张照片返回到第一张照片。我已经根据文档设置了prettyPhoto,但是我没有得到预期的效果。不知道我做错了什么。prettyPhoto在反向加载照片

这里有一个工作副本:radiant.dreamhosters.com

回答

0

这是有点怪,但我相信我解决了它。

问题 如果您查看链接,点击打开您的图库,您将看到链接是图库列表中的最后一幅图像。 即画廊链接到“图像/库存/ 1/5.jpg”,这是你的最后一个图像

因此它会带你到你的画廊的最后一张图片,因为这是你点击,你没有加载相反的图像,你正在选择最后的图像。

的修复

我所做的是给你的最上面的图片链接一个CSS的z-index通过CSS类,这种方式是你点击图像。用你的代码测试过它,它为我工作。

像这样:

< style> .first_img{ z-index: 10; } < /style >

< a class="first_img project_hoverPhoto" href="images/inventory/1/1.jpg" rel='prettyPhoto[1]'>

 <a class="project_hoverPhoto" href="images/inventory/1/3.jpg" rel='prettyPhoto[1]'></a> <a class="project_hoverPhoto" href="images/inventory/1/4.jpg" rel='prettyPhoto[1]'></a> <a class="project_hoverPhoto" href="images/inventory/1/5.jpg" rel='prettyPhoto[1]'></a> <img src="images/inventory/1/sm.jpg" alt="" width="280" height="140" /><div id="comments"><a class="comments" rel="#">$9,999.99</a></div> <h5>2003 Audi A4 Turbo</h5> 

+0

这是相当不错的聪明!我希望我早些时候检查过这个:) 我将问题追溯到位置:绝对;以及它如何堆叠图像并创建“最后在先”方案,就像您解释的一样。我的解决方案(+错误)是简单地从剩余的图像中取出类标签,并按广告方式工作。他们甚至不应该在那里:D – 2010-08-27 12:49:42

0

我知道你想只在每个画廊缩略图。为了达到这个结果,API将是更好的选择。寻找 “公共API” 文档该页面下:http://www.no-margin-for-errors.com/projects/prettyphoto-jquery-lightbox-clone/documentation/

图像= [ '图像/全屏/ image1.jpg', '图像/全屏/ image2.jpg',“图像/全屏/ image3.jpg “]; titles = ['Title 1','Title 2','Title 3'];描述= ['描述1','描述2','描述3'] $ .prettyPhoto.open(images,titles,descriptions);

希望这有助于:)