Skip to content

Instantly share code, notes, and snippets.

@michaeldeol
Forked from jiggliemon/thumbnails.js
Created May 4, 2011 20:18
Show Gist options
  • Save michaeldeol/955945 to your computer and use it in GitHub Desktop.
Save michaeldeol/955945 to your computer and use it in GitHub Desktop.
This should contain the stand alone code for the tumbnails, and their related functionality
//
// The code in this file should:
// - build a thumbnail container
// - populate the container with thumbnails
// - when a thumbnail is clicked, the main image should be updated with the appropriate image
//
// This code should be optional, and initiate itself if included.
//
(function(){
var thumbContainer = document.createDocumentFragment();
var thumbWrapper = document.createElement('div');
thumbWrapper.setAttribute('id','thumb-wrapper');
thumbContainer.appendChild(thumbWrapper);
document.body.appendChild(thumbContainer);
var thumbGallery = new IMG.Util().initialize('thumb');
})();
//
// The code in this file should:
// - built itself a viewport that will contain the medium images.
// - Update itself when/if a thumbnail is clicked.
// - provide the ability to have external elements switch images.
//
// This code should be optional, and initiate itself if included.
//
(function(){
var viewportContainer = document.createDocumentFragment();
var viewportWrapper = document.createElement('div');
viewportWrapper.setAttribute('id','viewport-wrapper');
viewportContainer.appendChild(viewportWrapper);
document.body.appendChild(viewportContainer);
var mediumGallery = new IMG.Util().initialize('medium');
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment