Continuing in my current project of rewriting all the javascript on Download.com (pity me), I encountered the functions on the screenshots page. A quick rewrite and here's my SimpleGallery class. It's not super-duper fancy but it's not meant to be.

Update: I had a bad js path in my header for the last day or so (doh!) so this example wasn't working at first. Fixed now...

Some html setup:

 of PreviousNext

Now we execute the function to set it up:

JavaScript:
new SimpleGallery({
  startIndex: 0,
  imgUrls: ['http://download.com/i/dl/media/dlimage/10/87/78/108778_medium.jpeg',
'http://download.com/i/dl/media/dlimage/10/87/79/108779_medium.jpeg',
'http://download.com/i/dl/media/dlimage/10/87/81/108781_medium.jpeg'],
  container: 'screenShotImgs',
  currentIndexContainer: 'imgNow',
  maxContainer: 'imgMax',
  nextImg: 'nextImg',
  prevImg: 'prevImg',
});
new SimpleGallery({
startIndex: 0,
imgUrls: ['http://download.com/i/dl/media/dlimage/10/87/78/108778_medium.jpeg',
'http://download.com/i/dl/media/dlimage/10/87/79/108779_medium.jpeg',
'http://download.com/i/dl/media/dlimage/10/87/81/108781_medium.jpeg'],
container: 'screenShotImgs',
currentIndexContainer: 'imgNow',
maxContainer: 'imgMax',
nextImg: 'nextImg',
prevImg: 'prevImg',
});

drag to resize