Skip to content

Instantly share code, notes, and snippets.

@agustinhaller
Created November 12, 2012 00:49
Show Gist options
  • Select an option

  • Save agustinhaller/4056953 to your computer and use it in GitHub Desktop.

Select an option

Save agustinhaller/4056953 to your computer and use it in GitHub Desktop.
aaa
// Product images scroller
$(".thumbnails-list").delegate(".thumbnail-item", "click", function(event){
event.preventDefault();
var thumb_image = $("img", this).attr('src'),
$thumb_image_container = $("img", this),
big_image = $(".product-images-wrapper .displayed-image").attr('src'),
$big_image_container = $(".product-images-wrapper .displayed-image");
// Now lets switch images
// Hide big one
$big_image_container.fadeOut(500, function(){
$thumb_image_container.attr('src', big_image);
$(this).attr('src', thumb_image);
$(this).delay(100).fadeIn(500);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment