06 gennaio 2007 alle 15:37:10 Modificato il 06 gennaio 2007 alle 15:38:19Java_Script, chi se ne intende? Ciao a tutti, a chi se ne intende! Chiedo un modifica ad un Java_Script, (un contatore) Sarebe da agiungere qualcosa in modo che sia la scrita che lo sfondo dove compare possono essere di colori diversi, in modo da sostituire poi in codice il colore dello sfondo e della scritta. Grazie! Ecco il codice dello script:
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(1999,3,2)
//STEP 2: Configure text to be attached to count up var displaymessage="have passed since the debut of our site!"
//STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countup area var countupwidth='95%' var countupheight='20px' //applicable only in NS4 var countupbgcolor='lightyellow' var opentags='<font face="Verdana"><small>' var closetags='</small></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+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags) document.countupnsmain.document.countupnssub.document.close() } else if (document.all||document.getElementById) crosscount.innerHTML=opentags+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" seconds "+displaymessage+closetags
06 gennaio 2007 alle 16:19:47 Modificato il 06 gennaio 2007 alle 16:23:26STEP 3 :configura le 5 variabili per settare larghezza altezza colore di sfondo e stile del testo
//STEP 3: Configure the below 5 variables to set the width, height, background color, and text style of the countup area var countupwidth='95%' var countupheight='20px' //applicable only in NS4 var countupbgcolor='lightyellow' var opentags='<font face="Verdana"><small>' var closetags='</small></font>'
visto che ci sono gia le opzioni non ho capito che modifche vuoi?
--------------- Silvio Andrighetti Formaggini (Piosky)
06 gennaio 2007 alle 17:38:51 Grazie piosky! gia le opzioni ho tirato due testate contro il muro, così la prossima volta aprirò ancora di più le palpebre ... Grazie! E visto che ci sei...non hai per caso il modulo che visualizza frasi a caso (le frasi le metto io)...tipo: modulo frasi celebre, etc...?
piosky_to2003
Esperto
2291 Discussioni
06 gennaio 2007 alle 18:00:54 no mi spiace moduli gia fatti che io sappia non ce ne sono , magari qualche utente ha fatto un blocco prendendo lo script su qualche sito di frasi barzellette etc etc
--------------- Silvio Andrighetti Formaggini (Piosky)
06 gennaio 2007 alle 18:21:46 Dopo il tuo PM ho cercato il modulo che avevo fatto qualche anno fa, ma non lo ho più trovato, probabilmente è finito nella spazzatura insieme all'hard disk che lo conteneva.
--------------- A lavare la testa ai somari, ci si rimette l'acqua e il sapone!