
Originariamente inviata da
Vincent.Zeno
ha voglia di mostrarci la tua?
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>