Visualizzazione dei risultati da 1 a 5 su 5
  1. #1
    Utente di HTML.it L'avatar di stre
    Registrato dal
    Nov 2001
    Messaggi
    15

    modificare slideshow con effetto fade

    Ciao,
    chi mi può aiutare a modificare questo script?
    Ho bisogno che si fermi dopo aver visualizzato l'ultima immagine ...
    Grazie grazie






    <META name="viewport" content="initial-scale=0.35, minimum-scale=0.2, maximum-scale=0.8" />
    <META name="apple-touch-fullscreen" content="YES" />
    <script type="text/javascript">
    function slideshow(){
    max_number_img = 12;
    i = 3;
    dispari = true;
    timer_cambio_img = setInterval('rullo()', 3000);
    }
    function rullo(){
    browser = null;
    if (window.ActiveXObject) {
    if (navigator.userAgent.toLowerCase().indexOf("msie 5") != -1) {
    browser = "ie";
    } else {
    browser = "ie";
    }
    }
    if (!browser && typeof(XMLHttpRequest) != 'undefined') {
    browser = "ch";
    }
    if(i < 10){
    src = "img_" + "0" + i;
    } else {
    src = "img_" + i;
    }

    timer_fade = setInterval('fade()', 100)
    }
    function fade(){
    if(browser == "ie"){
    if(dispari){
    var valore1 = document.getElementById("box_01").filters.alpha.op acity;
    var valore2 = document.getElementById("box_02").filters.alpha.op acity;
    var incremento = 5;
    if (valore1 < 100){
    valore1 = valore1 + incremento;
    document.getElementById("box_01").filters.alpha.op acity = valore1;
    valore2 = valore2 - incremento;
    document.getElementById("box_02").filters.alpha.op acity = valore2;
    } else {
    stop_timer(timer_fade);
    dispari = false;
    document.getElementById("box_02").src = "images/"+ src + ".jpg";
    if(i<max_number_img){
    i++;
    } else {
    i = 1;
    }

    }
    } else {
    var valore1 = document.getElementById("box_02").filters.alpha.op acity;
    var valore2 = document.getElementById("box_01").filters.alpha.op acity;
    var incremento = 5;
    if (valore1 < 100){
    valore1 = valore1 + incremento;
    document.getElementById("box_02").filters.alpha.op acity = valore1;
    valore2 = valore2 - incremento;
    document.getElementById("box_01").filters.alpha.op acity = valore2;
    } else {
    stop_timer(timer_fade);
    dispari = true;
    document.getElementById("box_01").src = "images/"+ src + ".jpg";
    if(i<max_number_img){
    i++;
    } else {
    i = 1;
    }
    }
    }
    } else {
    if(dispari){
    var valore1 = document.getElementById("box_01").style.opacity;
    var valore2 = document.getElementById("box_02").style.opacity;
    var incremento = 0.1;
    if (valore1 < 1){
    valore1 = eval(valore1) + eval(incremento);
    document.getElementById("box_01").style.opacity = valore1;
    valore2 = eval(valore2) - eval(incremento);
    document.getElementById("box_02").style.opacity = valore2;
    } else {
    stop_timer(timer_fade);
    dispari = false;
    document.getElementById("box_02").src = "images/"+ src + ".jpg";
    if(i<max_number_img){
    i++;
    } else {
    i = 1;
    }

    }
    } else {
    var valore1 = document.getElementById("box_02").style.opacity;
    var valore2 = document.getElementById("box_01").style.opacity;
    var incremento = 0.1;
    if (valore1 < 1){
    valore1 = eval(valore1) + eval(incremento);
    document.getElementById("box_02").style.opacity = valore1;
    valore2 = eval(valore2) - eval(incremento);
    document.getElementById("box_01").style.opacity = valore2;
    } else {
    stop_timer(timer_fade);
    dispari = true;
    document.getElementById("box_01").src = "images/"+ src + ".jpg";
    if( i < max_number_img ){
    i++;
    } else {
    i = 1;
    }
    }
    }
    }
    }
    function stop_timer(id){
    clearInterval(id);
    }

    </script>
    stefania

  2. #2

    Re: modificare slideshow con effetto fade

    Ciao Stefania
    Prova così:
    codice:
    
    <META name="viewport" content="initial-scale=0.35, minimum-scale=0.2, maximum-scale=0.8" />
    <META name="apple-touch-fullscreen" content="YES" />
    <script type="text/javascript">
    	function slideshow(){
    		 max_number_img = 12;
    		 i = 3;
    		 dispari = true;
    		 timer_cambio_img = setInterval('rullo()', 3000);
    	}
    	function rullo(){// non rullare che fa male alla salute....
    		browser = null;
    		if (window.ActiveXObject) {
    			if (navigator.userAgent.toLowerCase().indexOf("msie 5") != -1) {
    				browser = "ie";
    			} else {
    				browser = "ie";
    			}
    		}
    		if (!browser && typeof(XMLHttpRequest) != 'undefined') {
    			  browser = "ch";
    		}
    		if(i < 10){
    			src = "img_" + "0" + i;
    			} else {
    				src = "img_" + i;
    			}
    
    		timer_fade = setInterval('fade()', 100)
    	}
    	
    	function fade(){
    	if(browser == "ie"){
    	if(dispari){
    				var valore1 = document.getElementById("box_01").filters.alpha.opacity;
    				var valore2 = document.getElementById("box_02").filters.alpha.opacity;
    				var incremento = 5;
    					if (valore1 < 100){
    						valore1 = valore1 + incremento;
    						document.getElementById("box_01").filters.alpha.opacity = valore1;
    						valore2 = valore2 - incremento;
    						document.getElementById("box_02").filters.alpha.opacity = valore2;
    					} else {
    							stop_timer(timer_fade);
    							dispari = false;
    							document.getElementById("box_02").src = "images/"+ src + ".jpg";
    							if(i<max_number_img){
    							  i++;
    							} else {
    								clearInterval(timer_cambio_img);
    							}
    
    					}
    	} else {
    				var valore1 = document.getElementById("box_02").filters.alpha.opacity;
    				var valore2 = document.getElementById("box_01").filters.alpha.opacity;
    				var incremento = 5;
    					if (valore1 < 100){
    						valore1 = valore1 + incremento;
    							document.getElementById("box_02").filters.alpha.opacity = valore1;
    						valore2 = valore2 - incremento;
    							document.getElementById("box_01").filters.alpha.opacity = valore2;
    					} else {
    							stop_timer(timer_fade);
    							dispari = true;
    							document.getElementById("box_01").src = "images/"+ src + ".jpg";
    							if(i<max_number_img){
    							  i++;
    							} else {
    								clearInterval(timer_cambio_img);
    							}
    					}
    	}
    } else {
    	if(dispari){
    				var valore1 = document.getElementById("box_01").style.opacity;
    				var valore2 = document.getElementById("box_02").style.opacity;
    				var incremento = 0.1;
    					if (valore1 < 1){
    						valore1 = eval(valore1) + eval(incremento);
    							document.getElementById("box_01").style.opacity = valore1;
    						valore2 = eval(valore2) - eval(incremento);
    							document.getElementById("box_02").style.opacity = valore2;
    					} else {
    							stop_timer(timer_fade);
    							dispari = false;
    							document.getElementById("box_02").src = "images/"+ src + ".jpg";
    							if(i<max_number_img){
    							  i++;
    							} else {
    								clearInterval(timer_cambio_img);
    							}
    
    					}
    	} else {
    				var valore1 = document.getElementById("box_02").style.opacity;
    				var valore2 = document.getElementById("box_01").style.opacity;
    				var incremento = 0.1;
    					if (valore1 < 1){
    						valore1 = eval(valore1) + eval(incremento);
    							document.getElementById("box_02").style.opacity = valore1;
    						valore2 = eval(valore2) - eval(incremento);
    							document.getElementById("box_01").style.opacity = valore2;
    					} else {
    							stop_timer(timer_fade);
    							dispari = true;
    							document.getElementById("box_01").src = "images/"+ src + ".jpg";
    							if( i < max_number_img ){
    							  i++;
    							} else {
    								clearInterval(timer_cambio_img);
    							}
    					}
    	}
    }
    }
    function stop_timer(id){
    clearInterval(id);
    }
    
            </script>

  3. #3
    Utente di HTML.it L'avatar di stre
    Registrato dal
    Nov 2001
    Messaggi
    15
    Perfettissimo!
    Era proprio quello che mi serviva.
    Grazie grazie grazie, sei stato molto gentile!
    stefania

  4. #4
    Prego prego prego

  5. #5
    Utente di HTML.it
    Registrato dal
    Jul 2007
    Messaggi
    201

    modificare slideshow con effetto fade

    Ciao, cercavo questa risposta da giorni e spulciando nel sito l'ho trovata! Ma vorrei sapere se è possibile far fermare sull'ultima jpg per qualche minuto e poi ripartire. Grazie!!

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 © 2025 vBulletin Solutions, Inc. All rights reserved.