Visualizzazione dei risultati da 1 a 6 su 6

Discussione: countdown

  1. #1

    countdown

    Ciao a tutti, mi sapete indicare un countdown compatibile con firefox?
    ho provato
    questo

    ma con firefox non funziona

  2. #2
    Utente di HTML.it L'avatar di pietro09
    Registrato dal
    Jan 2002
    Messaggi
    10,116

    Re: countdown

    Originariamente inviato da Fello
    Ciao a tutti, mi sapete indicare un countdown compatibile con firefox?
    ho provato
    questo

    ma con firefox non funziona
    Questo forum è stato chiuso per una intera giornata e mostrava un bel contdown.
    Che vuoi che ti dica? prova ad aspettare alla prossima chiusura

    Oppure aspetta a domani mattina che recupero il codice

    Pietro

  3. #3
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133

    Re: countdown

    Originariamente inviato da Fello
    Ciao a tutti, mi sapete indicare un countdown compatibile con firefox?
    ho provato
    questo

    ma con firefox non funziona
    questo ( Link ) potrebbe andare?

    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  4. #4
    perfetto il link di cavicchiandrea

    Che vuoi che ti dica? prova ad aspettare alla prossima chiusura
    speriamo che le chiusure siano finite.....
    mi sento solo senza html.it!!!

  5. #5
    Utente di HTML.it L'avatar di pietro09
    Registrato dal
    Jan 2002
    Messaggi
    10,116
    Originariamente inviato da Fello
    perfetto il link di cavicchiandrea



    speriamo che le chiusure siano finite.....
    mi sento solo senza html.it!!!
    NATURALMENTE SCHERZAVO
    file countdown.js recuperato da quella antipatica pagina contdown.htm di qualche giorno fa:
    codice:
    function CD_T(id, e) {
    	var n	= new Date();
    	CD_D(+n, id, e);
    	setTimeout("CD_T('" + id + "', " + e + ")", 1100-n.getMilliseconds());
    };
    
    function CD_D(n, id, e) {
    	var ms = e - n;
    	if (ms <= 0) ms *= -1;
    	var d = Math.floor(ms/864E5);
    	ms -= d*864E5;
    	var h = Math.floor(ms/36E5);
    	ms -= h*36E5;
    	var m = Math.floor(ms/6E4);
    	ms -= m*6E4;
    	var s = Math.floor(ms/1E3);
    
    	CD_OBJS[id].innerHTML = d + " giorni, " + (d == 1 ? "" : "") + CD_ZP(h) + " ore, " + CD_ZP(m) + " minuti, " + CD_ZP(s) + " secondi";
    };
    
    function CD_ZP(i) {
    	return (i<10 ? "0" + i : i);
    };
    
    // Initialisation
    function CD_Init() {
    	var pref = "countdown";
    	var objH = 1;
    	if (document.getElementById || document.all) {
    		for (var i=1; objH; ++i) {
    			var id	= pref + i;
    			objH	= document.getElementById ? document.getElementById(id) : document.all[id];
    
    			if (objH && (typeof objH.innerHTML) != 'undefined') {
    				var s	= objH.innerHTML;
    				var dt	= CD_Parse(s);
    				if (!isNaN(dt)) {
    					CD_OBJS[id] = objH;
    					CD_T(id, dt.valueOf());
    					if (objH.style) {
    						objH.style.visibility = "visible";
    					}
    				}
    				else {
    					objH.innerHTML = s + "x";
    				}
    			}
    		}
    	}
    };
    
    function CD_Parse(strDate) {
    	var objReDte = /(\d{4})\-(\d{1,2})\-(\d{1,2})\s+(\d{1,2}):(\d{1,2}):(\d{0,2})\s+GMT([+\-])(\d{1,2}):?(\d{1,2})?/;
    
    	if (strDate.match(objReDte)) {
    
    		var d = new Date(0);
    
    		d.setUTCFullYear(+RegExp.$1,+RegExp.$2-1,+RegExp.$3); // Set YYYY-MM-DD directly as UTC
    		d.setUTCHours(+RegExp.$4,+RegExp.$5,+RegExp.$6); // Set HH:MM:SS directly as UTC
    
    		// If there is a timezone offset specified then we need to compensate for the offset from UTC
    		var tzs	= (RegExp.$7 == "-" ? -1 : 1); // Timezone sign
    		var tzh = +RegExp.$8; // Get requested timezone offset HH (offset ahead of UTC - may be negative)
    		var tzm = +RegExp.$9; // Get requested timezone offset MM (offset ahead of UTC - always positive)
    		if (tzh) {
    			d.setUTCHours(d.getUTCHours() - tzh*tzs); // Compensate for timezone HH offset from UTC
    		}
    		if (tzm) {
    			d.setUTCMinutes(d.getUTCMinutes() - tzm*tzs); // Compensate for timezone MM offset, depending on whether the requested MM offset is ahead or behind of UTC
    		}
    		return d; // Date now correctly parsed into a Date object correctly offset from UTC internally regardless of users current timezone.
    	}
    	else {
    		return NaN; // Didn't match required date format
    	};
    };
    
    var CD_OBJS = new Object();
    
    // Try not to commandeer the default onload handler if possible
    if (window.attachEvent) {
    	window.attachEvent('onload', CD_Init);
    }
    else if (window.addEventListener) {
    	window.addEventListener("load", CD_Init, false);
    }
    else {
    	window.onload = CD_Init;
    }

    la pagina html ha un segnaposto:
    <div id="countdown1">2016-04-18 18:44:00 GMT+02:00</div>

    Pietro

  6. #6
    Grazie pietro09!

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.