Skip to content

Instantly share code, notes, and snippets.

@walterdavis
Created August 29, 2012 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save walterdavis/3515917 to your computer and use it in GitHub Desktop.
Save walterdavis/3515917 to your computer and use it in GitHub Desktop.
var images = $('photoBox').hide().select('img');
images.each(function(img){
var link = new Element('a');
$('pickerBox').insert(link.wrap('p'));
link.href = img.src;
link.update(img.alt);
});
$('pickerBox').observe('click', function(evt){
var elm;
if(elm = evt.findElement('a')){
evt.stop();
document.body.background = elm.href;
}
});
document.body.background = images.first().src;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment