Skip to content

Instantly share code, notes, and snippets.

@jiggliemon
Created May 4, 2011 08:25
Show Gist options
  • Save jiggliemon/954929 to your computer and use it in GitHub Desktop.
Save jiggliemon/954929 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);
})();
//
// 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);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment