Skip to content

Instantly share code, notes, and snippets.

@nelsonJM
Created May 3, 2013 15:59
Show Gist options
  • Save nelsonJM/5510326 to your computer and use it in GitHub Desktop.
Save nelsonJM/5510326 to your computer and use it in GitHub Desktop.
jQuery: Thumbnail Nav with colorbox
<script>
( function ($) {
$('.window-list.thumbs').on('click','img', function(){ // When someone clicks on a thumbnail
var $this = $(this);
$('#main-image').fadeOut("1000",function() {
$('#main-image').attr('src',$this.attr('src').replace('-thumb','')).fadeIn("1000"); // Replace the Full Sized version of selected image
});
$('#ss-lightbox').attr('href',$this.attr('src').replace('-thumb',''));
});
})(jQuery);
</script>
<script type="text/javascript">
(function($) {
$(".group1").colorbox({
opacity : 0.5,
scalePhotos: true,
maxWidth: "1000px",
maxHeight: "450",
innerWidth: "1000px",
innerHeight: "450",
width: "1000px",
height: "450"
})
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment