Visualizzazione dei risultati da 1 a 5 su 5

Discussione: problemi con slideshow

  1. #1

    problemi con slideshow

    ciao ragazzi, volevo chiedervi un piacere:
    devo inserire per tre volte questo slideshow per immagini ma ogni volta ne parte uno solo. Come posso visualizzarli tutti e tre contemporaneamente?? Grazie, lo script è questo:

    codice:
    <script type="text/javascript">
    
    var terzo=new Array()
    
    //terzo[x]=["path to image", "OPTIONAL link for image", "OPTIONAL link target"]
    
    terzo[0]=['foto/foto1.jpg', '', '']
    terzo[1]=['foto/foto2.jpg', '', '']
    
    //configure the below 3 variables to set the dimension/background color of the slideshow
    
    var slidewidth="155px" //set to width of LARGEST image in your slideshow
    var slideheight="104px" //set to height of LARGEST iamge in your slideshow
    var slidecycles="continuos" //number of cycles before slideshow stops (ie: "2" or "continous")
    var randomorder="no" //randomize the order in which images are displayed? "yes" or "no"
    var preloadimages="yes" //preload images? "yes" or "no"
    var slidebgcolor='white'
    
    //configure the below variable to determine the delay between image rotations (in militeronds)
    var slidedelay=3000
    
    ////Do not edit pass this line////////////////
    
    var ie=document.all
    var dom=document.getElementById
    var curcycle=0
    
    if (preloadimages=="yes"){
    for (i=0;i<terzo.length;i++){
    var cacheimage=new Image()
    cacheimage.src=terzo[i][0]
    }
    }
    
    var currentslide=0
    
    function randomize(targetarray){
    terzoCopy=new Array()
    var the_one
    var z=0
    while (z<targetarray.length){
    the_one=Math.floor(Math.random()*targetarray.length)
    if (targetarray[the_one]!="_selected!"){
    terzoCopy[z]=targetarray[the_one]
    targetarray[the_one]="_selected!"
    z++
    }
    }
    }
    
    if (randomorder=="yes")
    randomize(terzo)
    else
    terzoCopy=terzo
    
    function rotateimages(){
    curcycle=(currentslide==0)? curcycle+1 : curcycle
    tercontainer='<center>'
    if (terzoCopy[currentslide][1]!="")
    tercontainer+='<a href="'+terzoCopy[currentslide][1]+'" target="'+terzoCopy[currentslide][2]+'">'
    tercontainer+='[img]'+terzoCopy[currentslide][0]+'[/img]'
    if (terzoCopy[currentslide][1]!="")
    tercontainer+='</a>'
    tercontainer+='</center>'
    if (ie||dom)
    crossrotateobj.innerHTML=tercontainer
    if (currentslide==terzo.length-1) currentslide=0
    else currentslide++
    if (curcycle==parseInt(slidecycles) && currentslide==0)
    return
    setTimeout("rotateimages()",slidedelay)
    }
    
    if (ie||dom)
    document.write('<div id="slidedom" style="width:'+slidewidth+';height:'+slideheight+'; background-color:'+slidebgcolor+'"></div>')
    
    function start_slider(){
    crossrotateobj=dom? document.getElementById("slidedom") : document.all.slidedom
    rotateimages()
    }
    
    if (ie||dom)
    window.onload=start_slider
    
    </script>

  2. #2
    Credo che il problema sia qui:

    var dom=document.getElementById

    L'id di un elemento è univoco. Se assegni id uguali nn funziona! E devi specificarlo come paraemtro nel metodo!
    I dilettanti costruirono l'Arca, i professionisti il Titanic!

  3. #3
    e come riesco a specificarlo nel metodo???

  4. #4
    come parametro getElementById("idelemento")
    I dilettanti costruirono l'Arca, i professionisti il Titanic!

  5. #5
    quindi creo due variabili
    dom=getElementById(nome1)
    dom1=getElementById(nome2)
    ??

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.