<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <div id="galeria"> <img alt="" src="img/IMG_4533.JPG" /> <img alt="" src="img/IMG_4540.JPG" /> <img alt="" src="img/IMG_4551.JPG" /> <img alt="" src="img/IMG_4553.JPG" /> <img alt="" src="img/IMG_4832.JPG" /> <img alt="" src="img/IMG_4838.JPG" /> <img alt="" src="img/IMG_4973.JPG" /> <img alt="" src="img/IMG_4997.JPG" /> <img alt="" src="img/IMG_5010.JPG" /> </div> </body> </html>
$(function(){ $("#galeria").hide(); collection = $("#galeria img").map(function() { return $(this).attr("src"); }).get(); i=0; j=collection.length; $('body').append("<img id='img' alt='' src='"+collection[i]+"' />"); if(i<=0) { $('#prev').hide(); $('#next').show(); } if(i>=j-1) { $('#next').hide(); $('#prev').show(); } $('#next').click(function(){ i = i + 1; $('#img').attr('src', collection[i]); }) $('#prev').click(function(){ $('#img').remove(); i = i - 1; $('#img').attr('src', collection[i]); }) });
Byłbym wdzięczny za jakąś wskazówkę. Z góry serdecznie dziękuję.
Pozdrawiam.