Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    problema visualizzazione javascript su mobile

    Buongiorno a tutti,
    premetto che sono abbastanza neofita dell'argomento e mi sto cimentando ora per la prima volta a fare un sito tutto mio.
    Ho usato un template responsive, e visualizzavo abbastanza bene il sito su tutti i device, da desktop al mobile. Nel momento in cui ho inserito il seguente script nella homepage, nei mobile vedo solo una pagina bianca in cui si vede solo le scritte che mi fa visualizzare lo script.
    Se può servire il sito è questo

    lo script è quello che fa vedere il countdown...

    il codice è il seguente:
    codice:
    <div  id="countdown" >
        <table  class ="coutdown_desktop" style="background-image: url('images/bg_countdown.gif'); border: 1px dotted #b32682; text-align: center; font-family: 'Indie Flower', cursive; font-size: 12pt; color: #b32682; width: 400px; margin: auto;">
    	<tbody>
    	    <tr>
    		<td>[img]images/sposini.png[/img]</td>
    		<td>
    		    <script type="text/javascript">
    			var before = "Ludovica & Alessandro ";
    			var current = "Ludovica & Alessandro... Oggi sposi!!!";
    			var montharray = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    			function countdown(yr, m, d) {
    			    var today = new Date();
    			    var todayy = today.getYear();
    			    if (todayy < 1000) {
    				todayy += 1900;
    			    }
    			    var todaym = today.getMonth();
    			    var todayd = today.getDate();
    			    var todaystring = montharray[todaym] + " " + todayd + ", " + todayy;
    			    var futurestring = montharray[m - 1] + " " + d + ", " + yr;
    			    var difference = (Math.round((Date.parse(futurestring) - Date.parse(todaystring)) / (24 * 60 * 60 * 1000)) * 1);
    			    if (difference === 0) {
    				document.write(current);
    			    } else if (difference > 0) {
    				document.write(before + "
    ...Sposi tra " + difference + " giorni!!");
    			    } else if (difference < 0) {
    				var da_gg = (difference * (-1));
    				document.write("Ludovica e Alessandro sposi da " + da_gg + " giorni!!");
    			    }
    			}
    			countdown(2014, 5, 31);
    
    		    </script>
    		</td>
    	    </tr>
    	</tbody>
        </table>
    </div>
    Spero di essere stata chiara e che mi sappiate aiutare!
    Grazie

  2. #2
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    A parte che hai un errore anche con IE8
    codice:
    Dettagli errore pagina Web
    Agente utente: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 1.1.4322; .NET4.0C; .NET4.0E; InfoPath.3)
    Timestamp: Fri, 5 Apr 2013 07:16:51 UTC
    Messaggio: 'gapi' non è definito
    Linea: 1
    Carattere: 44
    Codice: 0
    URI: https://hangoutsapi.talkgadget.googl...ngout.js?v=1.0
    Forse il problema di visualizzazione e dato perché chiami in div (countdown) e la funzione alla stesso modo prova a cambiare id
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  3. #3
    Purtroppo neanche la soluzione proposta da cavicchiandrea funziona, e oltre a questo si aggiunge il problema che mi ha segnalato su http://hangoutsapi.talkgadget.google...ngout.js?v=1.0 , di cui ho provato a mettere un'altra versione http://hangoutsapi.talkgadget.google...ngout.js?v=1.4 ma che mi da il seguente errore:
    codice:
    Dettagli errore pagina Web
    
    Agente utente: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET4.0C)
    Timestamp: Fri, 5 Apr 2013 07:52:51 UTC
    
    
    Messaggio: 'gadgets' non è definito
    Linea: 152
    Carattere: 415
    Codice: 0
    URI: http://hangoutsapi.talkgadget.google...ngout.js?v=1.4
    vi prego aiutatemi... vorrei non dover eliminare il countdown

  4. #4
    Come dicevo questa mattina ho provato a correggere quello che mi ha segnalato cavicchiandrea .


    il codice con la correzione è il seguente:
    codice:
    <div  id="count_box" >
        <table  class ="count_desktop" style="background-image: url('images/bg_countdown.gif'); border: 1px dotted #b32682; text-align: center; font-family: 'Indie Flower', cursive; font-size: 12pt; color: #b32682; width: 400px; margin: auto;">
    	<tbody>
    	    <tr>
    		<td></td>
    		<td>
    		    <script type="text/javascript">
    			var before = "Ludovica & Alessandro ";
    			var current = "Ludovica & Alessandro... Oggi sposi!!!";
    			var montharray = new Array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    			function countdown(yr, m, d) {
    			    var today = new Date();
    			    var todayy = today.getYear();
    			    if (todayy < 1000) {
    				todayy += 1900;
    			    }
    			    var todaym = today.getMonth();
    			    var todayd = today.getDate();
    			    var todaystring = montharray[todaym] + " " + todayd + ", " + todayy;
    			    var futurestring = montharray[m - 1] + " " + d + ", " + yr;
    			    var difference = (Math.round((Date.parse(futurestring) - Date.parse(todaystring)) / (24 * 60 * 60 * 1000)) * 1);
    			    if (difference === 0) {
    				document.write(current);
    			    } else if (difference > 0) {
    				document.write(before + "
    ...Sposi tra " + difference + " giorni!!");
    			    } else if (difference < 0) {
    				var da_gg = (difference * (-1));
    				document.write("Ludovica e Alessandro sposi da " + da_gg + " giorni!!");
    			    }
    			}
    			countdown(2014, 5, 31);
    
    		    </script>
    		</td>
    	    </tr>
    	</tbody>
        </table>
    </div>
    per piacere se avete suggerimenti, correzioni o altro aiutatemi!

  5. #5
    Ciao,
    ho risolto eliminando quel codice e usando invece jQuery e jQuery Coundown!

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.