Grazie a te Vincent.Zeno, dopo più di un mese, sono riuscito a fare quella parte della pagina!
Grazie a te Vincent.Zeno, dopo più di un mese, sono riuscito a fare quella parte della pagina!
Ultima modifica di pasQuiino; 18-03-2020 a 23:07
Certo!!
Non è ancora terminata, perché devo inserire un vincolo, oltre che al giorno anche all'ora e un timer che mi fa ricaricare lo script nel momento in cui deve passare all' "if" successivo. Se su questo riscontrerò difficoltà proverò a chiedere aiuto nella sezione dello Script. In ogni caso, il codice, funzionante, che ho attagliato a quello che chiedevo è questo.
codice:<script type="text/javascript" language="JavaScript"> var now = new Date(); var day = now.getDay(); var d = new Date(); var psj=0; //Lunedì if (day == 1 ){ adImages = new Array("ProgSett/5.jpg","ProgSett/1.jpg","ProgSett/2.jpg","ProgSett/3.jpg","ProgSett/4.jpg") thisAd = 0 imgCt = adImages.length function rotate() { if (document.images) { thisAd++ if (thisAd == imgCt) { thisAd = 0 } document.rotationImage.src=adImages[thisAd] setTimeout("rotate()", 5000) } } } //Martedì if (day == 2){ adImages = new Array("ProgSett/5.jpg","ProgSett/2.jpg","ProgSett/3.jpg","ProgSett/4.jpg") thisAd = 0 imgCt = adImages.length function rotate() { if (document.images) { thisAd++ if (thisAd == imgCt) { thisAd = 0 } document.rotationImage.src=adImages[thisAd] setTimeout("rotate()", 5000) } } } //Mercoledì if (day == 3){ adImages = new Array("ProgSett/5.jpg","ProgSett/3.jpg","ProgSett/4.jpg") thisAd = 0 imgCt = adImages.length function rotate() { if (document.images) { thisAd++ if (thisAd == imgCt) { thisAd = 0 } document.rotationImage.src=adImages[thisAd] setTimeout("rotate()", 5000) } } } //Giovedì if (day == 4){ adImages = new Array("ProgSett/5.jpg","ProgSett/4.jpg") thisAd = 0 imgCt = adImages.length function rotate() { if (document.images) { thisAd++ if (thisAd == imgCt) { thisAd = 0 } document.rotationImage.src=adImages[thisAd] setTimeout("rotate()", 5000) } } } //Venerdì if (day == 5){ adImages = new Array("ProgSett/5.jpg") thisAd = 0 imgCt = adImages.length function rotate() { if (document.images) { thisAd++ if (thisAd == imgCt) { thisAd = 0 } document.rotationImage.src=adImages[thisAd] setTimeout("rotate()", 5000) } } } </script>
Certamente! In ordine alla mia richiesta il codice funziona e fa quello che volevo. Devo però dire che dovrò fare delle modifiche per attagliarlo meglio alla finalità attesa (inserire anche il vincolo dell'ora e soprattutto un timer che rimandi alla condizione successiva; per qualche aiuto, magari chiederò nella sezione appropriata). In ogni caso, il codice è il seguente.
codice:<script type="text/javascript" language="JavaScript"> var now = new Date(); var day = now.getDay(); var d = new Date(); var psj=0; //Lunedì if (day == 1 ){ adImages = new Array("ProgSett/5.jpg","ProgSett/1.jpg","ProgSett/2.jpg","ProgSett/3.jpg","ProgSett/4.jpg") thisAd = 0 imgCt = adImages.length function rotate() { if (document.images) { thisAd++ if (thisAd == imgCt) { thisAd = 0 } document.rotationImage.src=adImages[thisAd] setTimeout("rotate()", 5000) } } } //Martedì if (day == 2){ adImages = new Array("ProgSett/5.jpg","ProgSett/2.jpg","ProgSett/3.jpg","ProgSett/4.jpg") thisAd = 0 imgCt = adImages.length function rotate() { if (document.images) { thisAd++ if (thisAd == imgCt) { thisAd = 0 } document.rotationImage.src=adImages[thisAd] setTimeout("rotate()", 5000) } } } //Mercoledì if (day == 3){ adImages = new Array("ProgSett/5.jpg","ProgSett/3.jpg","ProgSett/4.jpg") thisAd = 0 imgCt = adImages.length function rotate() { if (document.images) { thisAd++ if (thisAd == imgCt) { thisAd = 0 } document.rotationImage.src=adImages[thisAd] setTimeout("rotate()", 5000) } } } //Giovedì if (day == 4){ adImages = new Array("ProgSett/5.jpg","ProgSett/4.jpg") thisAd = 0 imgCt = adImages.length function rotate() { if (document.images) { thisAd++ if (thisAd == imgCt) { thisAd = 0 } document.rotationImage.src=adImages[thisAd] setTimeout("rotate()", 5000) } } } //Venerdì if (day == 5){ adImages = new Array("ProgSett/5.jpg") thisAd = 0 imgCt = adImages.length function rotate() { if (document.images) { thisAd++ if (thisAd == imgCt) { thisAd = 0 } document.rotationImage.src=adImages[thisAd] setTimeout("rotate()", 5000) } } } </script>