Skip to content

Instantly share code, notes, and snippets.

@nelsonJM
Created February 27, 2013 22:47
Show Gist options
  • Select an option

  • Save nelsonJM/5052576 to your computer and use it in GitHub Desktop.

Select an option

Save nelsonJM/5052576 to your computer and use it in GitHub Desktop.
jQuery: Thumbnail Nav
<style>
.product-gallery {
overflow: hidden;
position: relative;
height: 560px;
}
#featured-product li {
position: absolute;
top: 0;
}
.thumbs-section {
position: absolute;
bottom: 0;
height: auto;
border: 0;
.grid-thumbs {
overflow: hidden;
margin: 0;
}
}
.thumbs-section .grid-thumbs li {
display: block;
float: left;
margin-right: 20px;
a {
height: auto;
}
}
</style>
<script>
(function($) {
// var featuredProd = $('.prod');
// featuredProd.filter(':nth-child(n+2)').addClass('hide');
// $('.grid-thumbs li').click(function()
$('.grid-thumbs').on('click', 'li', function() {
var $this = $(this);
var thumb = $this.data('file');
$('#'+thumb)
.show()
.siblings('li')
.hide();
});
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment