jQuery: Basic Image Gallery


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var gallery = $("#previewGallery");
  2. var placeholder = gallery.find("#placeholder img");
  3. gallery.find("ul a").click(function() {
  4. var href = this.href;
  5. placeholder.attr("src", href);
  6. //placeholder.fadeOut("fast", function() {
  7. // $(this).attr("src", href).fadeIn("fast");
  8. //});
  9. return false;
  10. });

URL: http://jsfiddle.net/AKMHc/1/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.