Konu Başlığı: random image
View Single Post
Sponsorlu Bağlantılar
Zoque.Forum
Advertisement
Old 12.03.2007   #8 (permalink)
Visual
 
Visual's Avatar
 
Üyelik Tarihi: 15.03.2004
Yer: İstanbul
Yaş: 26
Mesaj: 84
Re: random image

Kod:
<script language="JavaScript">
<!--
function showImage()
{
theImages = new Array
theImages[0] = '100.jpg'
theImages[1] = '200.jpg'
theImages[2] = '300.jpg'
theImages[3] = '400.jpg'
theImages[4] = '500.jpg'

// ======================================
// do not change anything below this line
// ======================================

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));

document.write(theImages[whichImage]);
}

//-->
</script>

Mesaj Visual tarafından 12.03.2007 (22:20) yeniden düzenlendi..
Visual şu an çevrimdışı   Mesajdan alıntı yaparak yeni bir cevap ekleyin