Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var theImages = new Array()
- theImages[0] = 'img/CMbl.png'
- theImages[1] = 'img/CMo.png'
- theImages[2] = 'img/CMg.png'
- theImages[3] = 'img/CMp.png'
- theImages[4] = 'img/CMblu.png'
- var j = 0
- var p = theImages.length;
- var preBuffer = new Array()
- for (i = 0; i < p; i++){
- preBuffer[i] = new Image()
- preBuffer[i].src = theImages[i]
- }
- var whichImage = Math.round(Math.random()*(p-1));
- function showImage(){
- document.write('<img src="'+theImages[whichImage]+'">');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement