|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Sep 2004
Città: Brescia
Messaggi: 6574
|
Codice per conteggio tempo
Ragazzi ho una richiesta un po strana spero che qualcuno di voi possa venire incontro ...
Mi servirebbe un codice o un'animazione che partendo da una data che decido io vaccia vedere i giorni, ore , minuti , secondi tempo fa ho visto una pubblicità in internet fatta in flash che faceva il contdown giorno dopo giorno seconod dopo secondo spero che tra di voi ci sia qualcuno che possa aiutarmi grazie
__________________
![]() |
![]() |
![]() |
![]() |
#2 | |
Senior Member
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
|
Quote:
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%) |
|
![]() |
![]() |
![]() |
#4 | |
Senior Member
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
|
Quote:
Guarda che è praticamente lo stesso concetto del mio esempio .... tecnicamente basta solo scambiare le due date nel punto in cui viene effettuata la differenza ... ![]() ![]() (e cambiare le varie scritte di testo, ovviamente)
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%) |
|
![]() |
![]() |
![]() |
#5 | |
Senior Member
Iscritto dal: Sep 2004
Città: Brescia
Messaggi: 6574
|
Quote:
__________________
![]() |
|
![]() |
![]() |
![]() |
#6 |
Senior Member
Iscritto dal: Sep 2004
Città: Brescia
Messaggi: 6574
|
io ho trovato quello che cerco
Codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="it"> <head> </head> <body > <br /><br /> <div align="center"> <script language="JavaScript1.2"> //Dynamic countup Script- © Dynamic Drive (www.dynamicdrive.com) //For full source code, 100's more DHTML scripts, and TOS, //visit http://www.dynamicdrive.com function setcountup(theyear,themonth,theday){ yr=theyear;mo=themonth;da=theday } //////////CONFIGURE THE countup SCRIPT HERE////////////////// //STEP 1: Configure the date to count up from, in the format year, month, day: //This date should be less than today setcountup(2005,8,7) //STEP 2: Configure text to be attached to count up var displaymessage="da ... scoprite cosa" //STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countup area var countupwidth='100%' var countupheight='40px' //applicable only in NS4 var countupbgcolor='lightyellow' var opentags='<font face="Verdana"><big>' var closetags='</big></font>' //////////DO NOT EDIT PASS THIS LINE////////////////// var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") var crosscount='' function start_countup(){ if (document.layers) document.countupnsmain.visibility="show" else if (document.all||document.getElementById) crosscount=document.getElementById&&!document.all?document.getElementById("countupie") : countupie countup() } if (document.all||document.getElementById) document.write('<span id="countupie" style="width:'+countupwidth+'; background-color:'+countupbgcolor+'"></span>') window.onload=start_countup function countup(){ var today=new Date() var todayy=today.getYear() if (todayy < 1000) todayy+=1900 var todaym=today.getMonth() var todayd=today.getDate() var todayh=today.getHours() var todaymin=today.getMinutes() var todaysec=today.getSeconds() var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec paststring=montharray[mo-1]+" "+da+", "+yr dd=Date.parse(todaystring)-Date.parse(paststring) dday=Math.floor(dd/(60*60*1000*24)*1) dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1) dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1) dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1) if (document.layers){ document.countupnsmain.document.countupnssub.document.write(opentags+"Sono passati "+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+" da..." +closetags) document.countupnsmain.document.countupnssub.document.close() } else if (document.all||document.getElementById) crosscount.innerHTML=opentags+"Sono passati "+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+" da..."+closetags setTimeout("countup()",1000) } </script> <ilayer id="countupnsmain" width=&{countupwidth}; height=&{countupheight}; bgColor=&{countupbgcolor}; visibility=hide><layer id="countupnssub" width=&{countupwidth}; height=&{countupheight}; left=0 top=0></layer></ilayer> </div> <br /><br /><br /><br /><br /><br /> </body> </html> Praticamente dovrei linkare e visionare sul blog il contenuto di quella pagina in cui c'è solo quello script
__________________
![]() |
![]() |
![]() |
![]() |
#7 | |
Senior Member
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
|
Quote:
1) Prendi quel codice html che avevo postato in quel thread. 2) Riga 8, dove c'è var from_year = 2007; metti ad esempio 2006. 3) Riga 35, dove c'è var diff = d1 - d2; metti var diff = d2 - d1; (cioè si fa il contrario) Dimmi un po'... ti pare così difficile??? ![]() ![]() ![]()
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%) |
|
![]() |
![]() |
![]() |
#8 |
Senior Member
Iscritto dal: Sep 2004
Città: Brescia
Messaggi: 6574
|
ok
ora sorge un nuovo problema xkè msn non mi accetta il codice io avevo gia trovato un codice che fa la stessa cosa del tuo il problema è che vorrei richiamare quel codice che è contenuto in questa pagina <frame src="http://utenti.lycos.it/giaco29/coutup.htm"> all'interno del mio post di msn ma non so come fare tu hai qualche idea ?? Vedo che sei molto disponibile e ti ringrazio molto spero che riusciamo a venirne a capo Grazie GXp
__________________
![]() |
![]() |
![]() |
![]() |
#9 |
Senior Member
Iscritto dal: Sep 2004
Città: Brescia
Messaggi: 6574
|
Avrei una nuova domanda usando il codice da te indicato
Codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Date Countdown</title> <script type="text/javascript"> <!-- var from_year = 2006; var from_month = 1; var from_day = 1; var from_hour = 0; var from_minute = 0; var from_second = 0; var d1 = new Date (from_year, from_month-1, from_day, from_hour, from_minute, from_second); var old_second = -1; function countdown_format (d, h, m, s) { return "giorni: " + d + " / " + "ore: " + h + " / " + "minuti: " + m + " / " + "secondi: " + s; } function countdown_update () { var d2 = new Date (); var new_second = d2.getSeconds (); if (new_second != old_second) { var diff = d2 - d1; var str; if (diff > 0) { var seconds = Math.floor (diff / 1000) % 60; var minutes = Math.floor (diff / 60000) % 60; var hours = Math.floor (diff / 3600000) % 24; var days = Math.floor (diff / 86400000); str = countdown_format (days, hours, minutes, seconds); } else str = "Data superata!"; document.getElementById("countdown").innerHTML = str; old_second = new_second; } window.setTimeout (countdown_update, 100); } //--> </script> <style type="text/css"> <!-- #info { font: normal 16px sans-serif; color: red; } #countdown { font: bold 25px sans-serif; color: blue; } --> </style> </head> <body onload="countdown_update()"> <p> <span id="info"> Sono trascorsi: <b> <script type="text/javascript"> </script> </b> </span> <br> <br> <span id="countdown"></span> </p> </body> </html>
__________________
![]() |
![]() |
![]() |
![]() |
#10 | |
Senior Member
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
|
Quote:
Codice:
var days = Math.floor (diff / 86400000) % 365; var years = Math.floor (diff / 31536000000);
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%) |
|
![]() |
![]() |
![]() |
#11 |
Senior Member
Iscritto dal: Sep 2004
Città: Brescia
Messaggi: 6574
|
ho inserito quanto da te suggerito e modificato ma penso che manchi ancora qualcosa saresti cosi gentile da dirmi dove ho sbagliato
Codice:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Date Countdown</title> <script type="text/javascript"> <!-- var from_year = 2006; var from_month = 1; var from_day = 1; var from_hour = 0; var from_minute = 0; var from_second = 0; var d1 = new Date (from_year, from_month-1, from_day, from_hour, from_minute, from_second); var old_second = -1; function countdown_format (y,d, h, m, s) { return "anni:" "+ y + " / " + "giorni: " + d + " / " + "ore: " + h + " / " + "minuti: " + m + " / " + "secondi: " + s; } function countdown_update () { var d2 = new Date (); var new_second = d2.getSeconds (); if (new_second != old_second) { var diff = d2 - d1; var str; if (diff > 0) { var seconds = Math.floor (diff / 1000) % 60; var minutes = Math.floor (diff / 60000) % 60; var hours = Math.floor (diff / 3600000) % 24; var days = Math.floor (diff / 86400000) % 365; var years = Math.floor (diff / 31536000000); str = countdown_format (years,days, hours, minutes, seconds); } else str = "Data superata!"; document.getElementById("countdown").innerHTML = str; old_second = new_second; } window.setTimeout (countdown_update, 100); } //--> </script> <style type="text/css"> <!-- #info { font: normal 16px sans-serif; color: red; } #countdown { font: bold 25px sans-serif; color: blue; } --> </style> </head> <body onload="countdown_update()"> <p> <span id="info"> Sono trascorsi: <b> <script type="text/javascript"> </script> </b> </span> <br> <br> <span id="countdown"></span> </p> </body> </html>
__________________
![]() |
![]() |
![]() |
![]() |
#12 | |
Senior Member
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
|
Quote:
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%) |
|
![]() |
![]() |
![]() |
#13 |
Senior Member
Iscritto dal: Sep 2004
Città: Brescia
Messaggi: 6574
|
cavolo che sciocco ...
grazie ![]()
__________________
![]() |
![]() |
![]() |
![]() |
#14 |
Senior Member
Iscritto dal: Sep 2004
Città: Brescia
Messaggi: 6574
|
una domanda
dovrei collegare la pagina che ho creato al mio blog, che modalità ci sono per importare quella pagina in un post cercando su internet ho trovato che - NON DISPONIBILE - USARE IFRAME CON WINDOWS LIVE SPACES NON è POSSIBILE USARE ALCUNI CODICI HTML COME I CODICI CHE INIZIANO CON <iframe <frame <script (alcuni si alcuni no) <neoscript <textarea Tu che sei un esperto che modi ci sono per ovviare a tale problema ??
__________________
![]() |
![]() |
![]() |
![]() |
#15 | |
Senior Member
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
|
Quote:
![]() ![]() Vedo che <applet> non è elencato, quindi una applet potrebbe forse essere usata ma ... è Java ... un'altra cosa da Javascript. Dici "<script (alcuni si alcuni no)", quali sì e quali no, giusto per sapere??
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%) |
|
![]() |
![]() |
![]() |
#16 |
Senior Member
Iscritto dal: Sep 2004
Città: Brescia
Messaggi: 6574
|
si infatti è come hai detto tu
o meglio si carica ma appare una fienstra bianca con una X rossa io ho messo < applet http://utenti.lycos.it/giaco29/coutup.htm> giusto
__________________
![]() |
![]() |
![]() |
![]() |
#17 | |
Senior Member
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
|
Quote:
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%) |
|
![]() |
![]() |
![]() |
#18 | |
Senior Member
Iscritto dal: Sep 2004
Città: Brescia
Messaggi: 6574
|
Quote:
__________________
![]() |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 10:22.