• 24-10-2010, 13:42:34
    #1
    Merhabalar,
    2-3 Resimi Sayfa Yenilendikce Degisicek bir sekilde degismesini istiyorum.

    <script language="JavaScript">
    var theImages = new Array() 
    theImages[0] = 'http://www.pvp-kenti.com/pnl/logo/1.png'
    theImages[1] = 'http://www.pvp-kenti.com/pnl/logo/2.png'
    theImages[2] = 'http://www.pvp-kenti.com/pnl/logo/3.png'
    theImages[3] = 'http://www.pvp-kenti.com/pnl/logo/1.png'
    theImages[4] = 'http://www.pvp-kenti.com/pnl/logo/2.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]+'" style="margin-left:5px; border:0px;"');
    }
    </script>
    Böyle bir kod buldum fakat her resim için ayrı link koymak istiyorum nasıl yapabilirim?
  • 28-10-2010, 13:04:35
    #2
    Kimlik doğrulama veya yönetimden onay bekliyor.
    verdiğin kodda aşağıdan yazdığım yerdeki i=0 olan yer 0 dan başla diyor yani senin resim alanındaki ilk resim yani theImages[0] isimli resim.

    sen kaç resim varsa 0 ile o resim kadar bir random sayı ürettirerek 0 yerine o random sayıyı verdiğin değişkeni yazarsan sorunun çözülecektir.

    for (i = 0; i < p; i++){