jQuery Picture Gallery - How many lines of code will it take to write a simple photo gallery?
Demonstration of a simple jQuery/JavaScript image gallery with fewer than 20 lines of code: http://www.oproot.com/if/jquery-photo.html Source code: $('#thumbs img').click(function(){ $('#largeImage').attr('src',$(this).attr('src').replace('thumb','large')); $('#description').html($(this).attr('alt')); }); $('#thumbs').delegate('img','click', function(){ $('#largeImage').attr('src',$(this).attr('src').replace('thumb','large')); $('#description').html($(this).attr('alt')); });