ragazzi vorrei fare un aria nel sito che visualizza le new. vorrei avere un affetto movimento della scritta dal basso all'alto esiste una funzione javascipt che l osimula
Printable View
ragazzi vorrei fare un aria nel sito che visualizza le new. vorrei avere un affetto movimento della scritta dal basso all'alto esiste una funzione javascipt che l osimula
In Internet Explorer (e le ultime versioni di Firefox) è sufficiente il tag MARQUEE, usato così (nel tuo caso):L'alternativa, consigliata se vuoi avere un sito valido secondo il W3C, è quella di usare qualche javascript equivalente: prova a cercare marquee javascript anche qui sul forum...Codice HTML:<marquee width="..." height="..." direction="up">
Qui il testo da far scorrere
</marquee>
Stammi bene...
ragazzi ho inserito un oscript javascript ora mi chiedevo se c'era un modo per mettere tutto lo script in un file esterno e mettere una sola riga nel blocco dove visualizzare le new ho provato facendo<scipr url=""></script> ma nn mi funziona
la sintassi èCodice HTML:<script type="text/javascript" src="nomescript.js"></script>
nn mi funziona se cerco di importarlo...
Potresti scrivere il link della pagina dove stai provando lo script?
nn l'ho messa ancora in linea cmq questo è il codice
Codice HTML:<td height="79" bgcolor="#FFFFFF" align=center><script type="text/javascript">
//CONFIGURE MESSAGES AND VARIABLES
var tickercontents=new Array()
tickercontents[0]='Sveglia! È tempo di morire. (Leon in "Blade Runner")'
tickercontents[1]='Tutti muoiono, non tutti però vivono veramente. (da "BraveHeart")'
tickercontents[2]='Ma cos\'hai nella testa? Le scimmie urlatrici? (Da "Chiedimi se sono felice")'
var tickerwidth="500px"
var tickerheight="70px"
var fontcss="font: bold 14px Verdana; color:black"
var tickdelay=3000 //delay btw messages
var highlightspeed=2 //2 pixels at a time.
var highlightcolor="#c6c6c6"
var backdroptextcolor="#E1E1E1"
////Do not edit pass this line////////////////
document.write('<style>#highlighterbg a{color:'+backdroptextcolor+'}</style>')
document.write('<div style="position:relative;left:0px;top:0px; width:'+tickerwidth+'; height:'+tickerheight+';'+fontcss+'">')
document.write('<span id="highlighterbg" style="position:absolute;left:0;top:0;color:'+backdroptextcolor+'; width:'+tickerwidth+'; height:'+tickerheight+';padding: 4px"></span><span id="highlighter" style="position:absolute;left:0;top:0;clip:rect(auto auto auto 0px); background-color:'+highlightcolor+'; width:'+tickerwidth+';height:'+tickerheight+';padding: 4px"></span>')
document.write('</div>')
var currentmessage=0
var clipbottom=1
function changetickercontent(){
msgheight=clipbottom=crosstick.offsetHeight
crosstick.style.clip="rect("+msgheight+"px auto auto 0px)"
crosstickbg.innerHTML=tickercontents[currentmessage]
crosstick.innerHTML=tickercontents[currentmessage]
highlightmsg()
}
function highlightmsg(){
//var msgheight=crosstick.offsetHeight
if (clipbottom>0){
clipbottom-=highlightspeed
crosstick.style.clip="rect("+clipbottom+"px auto auto 0px)"
beginclip=setTimeout("highlightmsg()",20)
}
else{
clipbottom=msgheight
clearTimeout(beginclip)
if (currentmessage==tickercontents.length-1) currentmessage=0
else currentmessage++
setTimeout("changetickercontent()",tickdelay)
}
}
function start_ticking(){
crosstickbg=document.getElementById? document.getElementById("highlighterbg") : document.all.highlighterbg
crosstick=document.getElementById? document.getElementById("highlighter") : document.all.highlighter
crosstickParent=crosstick.parentNode? crosstick.parentNode : crosstick.parentElement
if (parseInt(crosstick.offsetHeight)>0)
crosstickParent.style.height=crosstick.offsetHeight+'px'
else
setTimeout("crosstickParent.style.height=crosstick.offsetHeight+'px'",100) //delay for Mozilla's sake
changetickercontent()
}
if (document.all || document.getElementById)
window.onload=start_ticking
</script>
</td>
io vorrei evitare tutto qusto scrivendo
<td><script ... url=""></script></td>
[DS] Usa i tag di codice quando ne riporti ampi stralci, si legge meglio... e non esce un post kilometrico.
Crei un file con estensione *.js dove inserirai:
Nella pagina scriverai:Codice://CONFIGURE MESSAGES AND VARIABLES
var tickercontents=new Array()
tickercontents[0]='Sveglia! È tempo di morire. (Leon in "Blade Runner")'
tickercontents[1]='Tutti muoiono, non tutti però vivono veramente. (da "BraveHeart")'
tickercontents[2]='Ma cos\'hai nella testa? Le scimmie urlatrici? (Da "Chiedimi se sono felice")'
var tickerwidth="500px"
var tickerheight="70px"
var fontcss="font: bold 14px Verdana; color:black"
var tickdelay=3000 //delay btw messages
var highlightspeed=2 //2 pixels at a time.
var highlightcolor="#c6c6c6"
var backdroptextcolor="#E1E1E1"
////Do not edit pass this line////////////////
document.write('<style>#highlighterbg a{color:'+backdroptextcolor+'}</style>')
document.write('<div style="position:relative;left:0px;top:0px; width:'+tickerwidth+'; height:'+tickerheight+';'+fontcss+'">')
document.write('<span id="highlighterbg" style="position:absolute;left:0;top:0;color:'+back droptextcolor+'; width:'+tickerwidth+'; height:'+tickerheight+';padding: 4px"></span><span id="highlighter" style="position:absolute;left:0;top:0;clip:rect(au to auto auto 0px); background-color:'+highlightcolor+'; width:'+tickerwidth+';height:'+tickerheight+';padd ing: 4px"></span>')
document.write('</div>')
var currentmessage=0
var clipbottom=1
function changetickercontent(){
msgheight=clipbottom=crosstick.offsetHeight
crosstick.style.clip="rect("+msgheight+"px auto auto 0px)"
crosstickbg.innerHTML=tickercontents[currentmessage]
crosstick.innerHTML=tickercontents[currentmessage]
highlightmsg()
}
function highlightmsg(){
//var msgheight=crosstick.offsetHeight
if (clipbottom>0){
clipbottom-=highlightspeed
crosstick.style.clip="rect("+clipbottom+"px auto auto 0px)"
beginclip=setTimeout("highlightmsg()",20)
}
else{
clipbottom=msgheight
clearTimeout(beginclip)
if (currentmessage==tickercontents.length-1) currentmessage=0
else currentmessage++
setTimeout("changetickercontent()",tickdelay)
}
}
function start_ticking(){
crosstickbg=document.getElementById? document.getElementById("highlighterbg") : document.all.highlighterbg
crosstick=document.getElementById? document.getElementById("highlighter") : document.all.highlighter
crosstickParent=crosstick.parentNode? crosstick.parentNode : crosstick.parentElement
if (parseInt(crosstick.offsetHeight)>0)
crosstickParent.style.height=crosstick.offsetHeigh t+'px'
else
setTimeout("crosstickParent.style.height=crosstick .offsetHeight+'px'",100) //delay for Mozilla's sake
changetickercontent()
}
if (document.all || document.getElementById)
window.onload=start_ticking
Codice HTML:<td><script type="text/javascript" src="nomescript.js"></script></td>