Skip to content

Instantly share code, notes, and snippets.

@fuba
Created September 18, 2012 16:12
Show Gist options
  • Save fuba/3744009 to your computer and use it in GitHub Desktop.
Save fuba/3744009 to your computer and use it in GitHub Desktop.
var tColors = document.querySelectorAll('select#tColorSelector option');
var logoColors = document.querySelectorAll('select#logoColorSelector option');
window.setTimeout(function changeTshirt () {
var i = parseInt( Math.random() * tColors.length );
var colorId = tColors[i].className;
var num = ('00' + colorId).slice(-3);
$('#tBase img').attr('src', '/issue/okadada_t/images/t/' + num + '.jpg');
var logoId = logoColors[parseInt( Math.random() * logoColors.length )].className;
$('#tLogo img').attr('src', "/issue/okadada_t/images/okadada_" + logoId + ".png");
window.setTimeout( changeTshirt, 33 );
}, 33);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment