For Loop + Lightbox
For Loop + Lightbox
I have the following code located in a for loop with over 10 entries:
- var p_photos = $("<p>").addClass("photos").appendTo(div);
- var span_photo = $("<span>").text("Picture Gallery: ").appendTo(p_photos);
-
- var a_photo = $("<a>").attr("href", "img/fs/1.jpg").text("Click For Image Reel!").appendTo(span_photo);
- $("<a>").attr("href", "img/fs/2.jpg").appendTo(span_photo);
- $("<a>").attr("href", "img/fs/3.jpg").appendTo(span_photo);
-
- $('p.photos span a').lightBox({fixedNavigation:true});
I am using this Lightbox: http://leandrovieira.com/projects/jquery/lightbox/
What is happening is that each entry has 3 pictures associated with it and therefore, all 3 are being appended to one another during each loop. It is making it so that the Lightbox popup has 30 pictures, when it should only have 3.
How can I work around this?
Thanks!