Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
HTML, Javascript, CSS, DHTML, XHTML
Incompatibilità tra due script
mercoledì 17 ottobre 2007 - 13.34
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
lucavizzi
Profilo
| Newbie
1
messaggi | Data Invio:
mer 17 ott 2007 - 13:34
Salve a tutti,
utilizzo il seguente script per ottenere uno scrolling delle mie news:
<script type="text/javascript">
/***********************************************
* Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit
http://www.dynamicdrive.com/
for this script and 100s more.
***********************************************/
var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
////NO NEED TO EDIT BELOW THIS LINE////////////
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''
function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}
function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=100
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}
if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee
function espandinews(nr,btn) {
if (document.getElementById(nr)) {
var el=document.getElementById(nr);
var pulsante=document.getElementById(btn);
el.style.display = (el.style.display=="block") ? "none" : "block";
pulsante.innerHTML = (pulsante.innerHTML=="Nascondi") ? "Visualizza" : "Nascondi";
alert (actualheight);
}
}
</script>
l'ultima funzione: 'espandinews' l'ho aggiunta io per far sì che le news siano nascoste e visualizzate al click di un link.
tutto funziona perfettamente se le news al caricamento della pagina hanno come stile display:block.
Mentre non funziona nel caso che interessa a me e cioè con stile display=none;
Qualcuno sa aiutarmi?
Grazie
Luca
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !