|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Member
Iscritto dal: Feb 2008
Messaggi: 84
|
[Javascript] Aiuto codice js per effetto scritta scorrevole
Salve, mi sapreste aiutare? io ho un codice javascript e non me ne intento, l'ho solo trovato in rete e lo volevo usare per il mio sito creato con joomla, però mi guardate se c'è qualche errore nel codice? Dovrebbe dare una scritta che scorre effetto titoli film...
Codice:
<HTML>
<HEAD>
<TITLE> INCONTRO </TITLE>
</HEAD>
<BODY>
<script language="JavaScript1.2">
//Specify the marquee's width (in pixels)
var marqueewidth=330
//Specify the marquee's height
var marqueeheight=150
//Specify the marquee's scroll speed (larger is faster)
var speed=1
//Specify the marquee contents
var marqueecontents='<center><center><font face="Comic Sans MS"><strong>SABATO 20 NOVEMBRE TORRE CONTRO PIOBBICO 90'
if (document.all){
document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')}
else if(document.layers){
document.write('<ilayer id="cmarquee01" width="'+marqueewidth+'" height="'+marqueeheight+'"><layer id="cmarquee02" width="'+marqueewidth+'" height="'+marqueeheight+'"></layer></ilayer>')}
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450)
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
document.cmarquee01.document.cmarquee02.document.close()
thelength=document.cmarquee01.document.cmarquee02.document.height
scrollit()
}
function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed
setTimeout("scrollit()",100)
}
else{
document.cmarquee01.document.cmarquee02.top=marqueeheight
scrollit()
}
}
window.onload=regenerate2
// -->
</script>
</BODY>
</HTML>
|
|
|
|
|
|
#2 |
|
Member
Iscritto dal: Dec 2008
Messaggi: 82
|
il problema è che document.all e document.layers sono vuoti... dovresti capire in che contesto inserire questo.
Secondo me ti conviene inserire il tag <MARQUEE> direttamente nell' html e poi te lo sistemi con css
__________________
Software house Manfriday |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 16:40.



















