如何在Lightbox中显示第一张不是最后一张图片?

时间:2012-09-05 12:35:11

标签: javascript lightbox

您好我使用这样的灯箱:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
    <script src="lightbox/js/lightbox.js"></script>
    <link href="lightbox/css/lightbox.css" rel="stylesheet" />
    <title></title>
    </head>

<body>

<a href='http://polishwords.com.pl/images/logo179x24.png' rel="lightbox[roadtrip]"><img src="http://polishwords.com.pl/images/logo179x24.png"  /></a>      
<a href='http://polishwords.com.pl/images/logo179x24.png' rel="lightbox[roadtrip]"><img src="http://polishwords.com.pl/images/logo179x24.png"  /></a>
<a href='http://polishwords.com.pl/images/logo179x24.png' rel="lightbox[roadtrip]"><img src="http://polishwords.com.pl/images/logo179x24.png"  /></a>


</body>

</html>

现场演示:http://polishwords.com.pl/grono/fb_dragchallenge2/test.html

当我点击任何图像时,它显示图库,但图像3/3不是图像1/3。 如何显示第一张图片而不是最后一张图片?

我用这个:http://lokeshdhakar.com/projects/lightbox2/

3 个答案:

答案 0 :(得分:0)

尝试将它们放入像这样的组中:

<a href="images/image-1.jpg" rel="lightbox[roadtrip]">image #1</a>
<a href="images/image-2.jpg" rel="lightbox[roadtrip]">image #2</a>
<a href="images/image-3.jpg" rel="lightbox[roadtrip]">image #3</a>

答案 1 :(得分:0)

这是上面链接中最新版灯箱的错误。我已经改用其他软件了。

答案 2 :(得分:0)

函数Lightbox.prototype.start(lightbox.js)中存在错误。将图片添加到相册后,变量imageNumber仍然包含最后一张图片的编号。

imageNumber函数调用之前将0更改为this.changeImage

imageNumber = 0; // insert this line before 
this.changeImage(imageNumber);