
Originariamente inviata da
ciro78
Ciao pasQuilino,
Infine ti consiglio di aprire una discussione diversa per argomento (ad esempio il testo scorrevole era tranquillamente un'altra discussione)
Chiedo scusa ma avevo capito che dovevo spostarla di sezione. Lì comunque ho risolto il problema e pensavo di averlo aperto qui.
Per il mio secondo problema non fa nulla, era una "finezza" superflua.
Comunque ho cercato di risolvere con un do while ma penso di essere incappato in un loop infinito.
codice:
<script type="text/javascript" language="JavaScript">
var now = new Date();
var day = now.getDay();
var hours = now.getHours();
var d = new Date();
var psj=0;
//Nuova settimana didattica
do{
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++
document.rotationImage.src=adImages[thisAd]
setTimeout("rotate()", 5000)
}
}
} while (day == 5 && hours >= 13 || day == 6 || day == 0 || day == 1 && hours < 17)
//Dalle 17:00 del Lunedì alle 16:59 del Martedì
do {
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++
document.rotationImage.src=adImages[thisAd]
setTimeout("rotate()", 5000)
}
}
} while (day == 1 && hours >= 17 || day == 2 && hours < 17)
//Dalle 17:00 del Martedì alle 16:59 del Mercoledì
do {
adImages = new Array("ProgSett/5.jpg","ProgSett/3.jpg","ProgSett/4.jpg")
thisAd = 0
imgCt = adImages.length
function rotate() {
if (document.images) {
thisAd++
document.rotationImage.src=adImages[thisAd]
setTimeout("rotate()", 5000)
}
}
} while (day == 2 && hours >= 17 || day == 3 && hours < 17)
//Dalle 17:00 del Mercoledì alle 16:59 del Giovedì
do {
adImages = new Array("ProgSett/5.jpg","ProgSett/4.jpg")
thisAd = 0
imgCt = adImages.length
function rotate() {
if (document.images) {
thisAd++
document.rotationImage.src=adImages[thisAd]
setTimeout("rotate()", 5000)
}
}
} while (day == 3 && hours >= 17 || day == 4 && hours < 17)
//Dalle 17:00 del Giovedì alle 12:59 del Venerdì
do {
adImages = new Array("ProgSett/5.jpg")
thisAd = 0
imgCt = adImages.length
function rotate() {
if (document.images) {
thisAd++
document.rotationImage.src=adImages[thisAd]
setTimeout("rotate()", 5000)
}
}
} while (day == 4 && hours >= 17 || day == 5 && hours < 13)
//Dalle 13:00 del Venerdì
do {
adImages = new Array("ProgSett/6.jpg")
thisAd = 0
imgCt = adImages.length
function rotate() {
if (document.images) {
thisAd++
document.rotationImage.src=adImages[thisAd]
setTimeout("rotate()", 5000)
}
}
} while (day == 5 && hours >= 13)
</script>