Response title
This is preview!
I am creating a next button and I am trying to use a for loop to get the next image in the using and with a class i call lightbox.
$('#next').live('click',function(){
var Picture = $('.lightbox'); // path to full sized picture,
var num = Picture.length
for (i = 0; i < num; ++i) {
$('.box img').remove();
$('.box').append('<img align="center" id="motown" src="'+Picture[i]+'" style=" z-index:52px;" > ');
};
});
The only problem is, instead of showing the next image it loops through all the way to the last image i the list, please help. I tried using the .next()
function, it did not work. could someone please help with this.
© 2013 jQuery Foundation
Sponsored by and others.