stuck with message scroller

S

Sigmun

Help, I'm stuck with this code, I'm new in javascript and don't know what
else can I do because I tried everything.



I have a message scroller in this homepage :



http://www.min-agricultura.pt



The problem is that I can't decrease the delay between the messages, in that
delay the message frame stays blank/white. The speed is good, I only want
that the next message appears right when the predecessor ends in order to
avoid that white frame delay.



can someone help me on this ?



the code is bellow the line

=================================



<html>
<head>
<title>Multiple Message Scroller V3.0</title>
<!-- STEP I: Goes between <HEAD> & </HEAD> tags
You may keep it, change or ignore it!-->
<style type="text/css">
A.tabb:link {color:black;}
A.tabb:visited{color: blue;}
A.tabb:hover {color: red;}
.tabb { font-weight:bold; font-size:14px; font-family:Arial;}
.tan {FONT-SIZE: 12px; COLOR: navy; FONT-FAMILY: Arial; TEXT-ALIGN: center}
.tann {FONT-WEIGHT: bold;FONT-SIZE: 18px; COLOR: navy; FONT-FAMILY: Arial;
TEXT-ALIGN: left}
</style>
<!-- STEP II: Goes between <HEAD> & </HEAD> tags-->
<SCRIPT LANGUAGE="JavaScript">
/************************************
* This notice may not be removed *
* http://members.rogers.com/bazil/ *
*************************************/
//-- Begin Scroller's Parameters and messages -->
//scroller's width
var swidth=500;
//scroller's height
var sheight=100;
//scroller's speed
var sspeed=2;
var restart=sspeed;
var rspeed=sspeed;
//scroller's background
sbcolor="#ffffff";
//messages: change to your own; use as many as you'd like; set up Hyperlinks
to URLs as you normally do: <a target=... href="... URL ...">..message..</a>
var singletext=new Array();
singletext[0]='<table border="0" cellpadding="2" cellspacing="0"
width="100%"> <tr> <td width="10%" valign="top" rowspan="2"><img
src="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/FLASH/IMAGENS/
CATS_DOGS.JPG" alt="CÃES E GATOS - NOVA LEGISLAÇÃO"></td> <td
width="90%"><span style="font-family: Tahoma; font-size: 11px"><strong>CÃES
E GATOS - Nova Legislação</strong></span><span style="font-family:
Tahoma; font-size: 12px"> </span></td> </tr> <tr> <td width="90%"><ul
style="color: rgb(0,128,0); text-align: left" type="square"> <li><span
style="font-family: Tahoma; font-size: 10px"><font color="#000000">Aprova o
Regulamento de Registo, Classificação e Licenciamento de Cães e Gatos.
Portaria n.º 421/2004. DR n.º 97, I-B Série de 2004.04.24&nbsp;
</font><font color="#009900"><a
href="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/CA_LEGISLACAO
/F_LEGIS_2004/F_TEXTOS_04/Port_421_0.htm"
target="_blank"><em>ver</em></a></font></span></li> <li><span
style="font-family: Tahoma; font-size: 10px"><font color="#000000">Determina
as raças de cães e os cruzamentos de raças potencialmente perigosos.
Portaria n.º 422/2004. DR n.º 97, I-B Série de 2004.04.24&nbsp;
</font><a
href="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/CA_LEGISLACAO
/F_LEGIS_2004/F_TEXTOS_04/Port_422_0.htm" target="_blank"><font
color="#009900"><em>ver</em></font></a></span></li> </ul> </td>
</tr></table>'
singletext[1]='<table border="0" cellpadding="2" cellspacing="0"
width="100%"> <tr> <td width="10%" valign="top" rowspan="2"><img
src="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/FLASH/IMAGENS/
FOGO_0.JPG" alt="VOLUNTARIADO PARA AS FLORESTAS" border="0"></td> <td
width="90%" valign="top"><strong><span style="font-family: Tahoma;
font-size: 11px">VOLUNTARIADO PARA AS FLORESTAS </span></strong><p><span
style="font-family: Tahoma; font-size: 11px">Projecto transversal entre
as Secretaria de Estado das Florestas, da Juventude e Desportos e da
Administração do Território, envolvendo os Institutos Português da
Juventude, do Ambiente, Conservação da Natureza e a Direcção Geral dos
Recursos Florestais </span><a
href="http://www.min-agricultura.pt/oportal/extcnt/PORTAL30.wwv_media.show_n
ewwindow?p_id=246642&amp;p_currcornerid=55246&amp;p_settingssetid=55173&amp;
p_settingssiteid=133&amp;p_siteid=133&amp;p_title=VOLUNTARIADO%20PARA%20AS%2
0FLORESTAS&amp;p_type=text&amp;p_textid=246643" target="_blank"
style="color: rgb(0,128,0)"><i><span style="font-family: Tahoma;
font-size: 10px"><font color="#000000">ver</font></span></i></a></td> </tr>
<tr> <td width="90%" valign="top"></td> </tr></table>'
singletext[2]='<table border="0" cellpadding="2" cellspacing="0"
width="100%"> <tr> <td width="10%" valign="top" rowspan="2"><img
src="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/FLASH/IMAGENS/
SEV1.JPG" alt="REFORMA DO SECTOR DO AZEITE" border="0"></td> <td
width="90%" valign="top"><span style="font-family: Tahoma; font-size:
11px"><strong>REFORMA DO SECTOR DO AZEITE, TABACO, ALGODÃO E LÚPULO<br>
</strong>Após uma maratona negocial de 17 horas no Luxemburgo, os Ministros
da Agricultura da União Europeia chegaram a acordo sobre a reforma dos
sectores do azeite, tabaco, algodão e lúpulo. No final, o Ministro da
Agricultura, Eng. Armando Sevinate Pinto, disse: &quot;Foi uma negociação
complicada, mas nunca escondi ter uma expectativa positiva. Atingimos os
objectivos que tínhamos e as nossas pretensões eram justas.&quot;
</span></td> </tr> <tr> <td width="90%" valign="top"><ul style="color:
rgb(0,128,0)" type="square"> <li><span style="font-family: Tahoma;
font-size: 10px"><font color="#000000">Negociações Agricolas
Europeias (Azeite e Tabaco) - Luxemburgo, 22 de Abril de 2004. <a
href="http://www.min-agricultura.pt/oportal/extcnt/PORTAL30.wwv_media.show_n
ewwindow?p_id=246551&amp;p_currcornerid=55246&amp;p_settingssetid=55173&amp;
p_settingssiteid=133&amp;p_siteid=133&amp;p_title=NEGOCIA%C7%D5ES%20AGR%CDCO
LAS%20EUROPEIAS%20-%20(AZEITE%20E%20TABACO)&amp;p_type=text&amp;p_textid=246
552" target="_blank" style="color:
rgb(0,128,0)"><i>ver</i></a></font></span></li> </ul> <p>&nbsp;</td>
</tr></table>'
singletext[3]='<table border="0" cellpadding="2" cellspacing="0"
width="100%"> <tr> <td width="10%" valign="top" rowspan="2"><img
src="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/FLASH/IMAGENS/
floresta.jpg" alt="REFORMA ESTRUTURAL DO SECTOR FLORESTAL"></td> <td
width="90%"><strong><span style="font-family: Tahoma; font-size:
11px">REFORMA ESTRUTURAL DO SECTOR FLORESTAL </span></strong></td> </tr>
<tr> <td width="90%"><ul style="color: rgb(0,128,0); text-align: left;
line-height: -12px" type="square"> <li><font color="#000000"><span
style="font-family: Tahoma; font-size: 10px">Criação de <strong>equipas de
sapadores florestais e regulamentação a sua actividade</strong>. DL. nº
94/2004. DR n.º 95, I-A Série, de 2004.04.22 <a
href="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/CA_LEGISLACAO
/F_LEGIS_2004/F_TEXTOS_04/DL_94.htm" target="_blank" style="color:
rgb(0,128,0)"><i>ver</i></a></span></font></li> <li><font
color="#000000"><span style="font-family: Tahoma; font-size: 10px">Criação
da <strong>Agência para a Prevenção de Incêndios Florestais</strong>.
Decreto Regul. nº 5/2004. DR n.º 94, I-B Série, de 2004.04.21 <a
href="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/CA_LEGISLACAO
/F_LEGIS_2004/F_TEXTOS_04/Dec-R_5.htm" target="_blank" style="color:
rgb(0,128,0)"><i>ver</i></a></span></font></li> <li><font
color="#000000"><span style="font-family: Tahoma; font-size: 10px">Criação
da <strong>Direcção-Geral dos Recursos Florestais.
</strong>Decreto-Lei n.º 80/2004. DR n.º 85, I-A Série, de
2004.04.10<strong> </strong><a
href="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/CA_LEGISLACAO
/F_LEGIS_2004/F_TEXTOS_04/DL_80_0.htm" target="_blank" style="color:
rgb(0,128,0)"><i>ver</i></a></span></font></li> <li><font
color="#000000"><span style="font-family: Tahoma; font-size: 10px">Fundo
Florestal Permanente. Decreto-Lei n.º 63/2004. DR n.º 69, I-A Série,
de 2004.03.22 <a
href="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/CA_LEGISLACAO
/F_LEGIS_2004/F_TEXTOS_04/DL_63.htm" target="_blank" style="color:
rgb(0,128,0)"><i>ver</i></a></span></font></li> <li><font
color="#000000"><span style="font-family: Tahoma; font-size: 10px">Resolução
do Conselho de Ministros nº 178/2003. DR nº 266, I-B Série de
2003.11.17 <a
href="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/CA_LEGISLACAO
/F_LEGIS_2003/F_TEXTOS_03/RCM_178.htm" target="_blank" style="color:
rgb(0,128,0)"><i>ver</i></a></span></font></li> </ul> </td>
</tr></table>'
singletext[4]='<table border="0" cellpadding="2" cellspacing="0"
width="100%"><tr> <td width="10%" valign="top"><img
src="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/FLASH/IMAGENS/
agro.gif" alt="AGRO"></td> <td width="90%"><strong><span
style="font-family: Tahoma; font-size: 11px">PROGRAMA AGRO - Medida
2</span><br> </strong><br> <span style="font-family: Tahoma;
font-size: 10px">Foi publicada a <strong>Portaria n.º 364/2004</strong>,
no DR n.º 84, I-B Série de 8 de Abril de 2004, que altera o Regulamento de
Aplicação da Medida 2: &quot;Transformação e Comercialização dos Produtos
Agrícolas&quot. <i><a
href="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/CA_LEGISLACAO
/F_LEGIS_QCAIII/QCA_3/Port_364_0.HTM"
target="_blank">ver</a></i></span></td> </tr> </table>'
singletext[5]='<table border="0" cellpadding="2" cellspacing="0"
width="100%"> <tr> <td width="10%" valign="top" rowspan="2"><img
src="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/FLASH/IMAGENS/
fito.jpg" alt="USO DE PRODUTOS FITOFARMACÊUTICOS"></td> <td
width="90%"><span style="font-family: Tahoma; font-size: 11px"><strong>USO
DE PRODUTOS FITOFARMACÊUTICOS</strong></span><span style="font-family:
Tahoma; font-size: 10px"> <br> Foi aprovado em Conselho de Ministros do
dia 24 de Março, o Decreto-Lei que altera e aprova alguns limites máximos
de resíduos de substâncias activas de produtos fitofarmacêuticos
permitidos nos produtos agrícolas de origem vegetal, incluindo frutos,
hortícolas e cereais, transpondo para a ordem jurídica nacional as
Directivas 2003/113/CE, 2003/118/CE e 2004/2/CE da Comissão,
respectivamente, de 3 de Dezembro de 2003, de 5 de Dezembro de 2003 e de
9 de Janeiro de 2004, na parte respeitante aos produtos agrícolas de
origem vegetal. <a
href="http://www.governo.gov.pt/Portal/PT/Governos/Governos_Constitucionais/
GC15/Conselho_de_Ministros/Comunicados_e_Conferencias_de_Imprensa/20040324.h
tm" target="_blank" style="color:
rgb(0,128,0)"><i>ver</i></a></span></td> </tr> <tr> <td width="90%"><ul
style="color: rgb(0,128,0); text-align: justify" type="square">
<li><font color="#000000"><span style="font-family: Tahoma; font-size:
10px">Actualização das Finalidades não cobertas em consequência da
retirada do mercado de substâncias activas e do estabelecimento de
Limites Máximos de Resíduos. <a
href="http://www.dgpc.min-agricultura.pt/fitofarmaceuticos/finalidades_nao_c
obertas_indice.htm" target="_blank" style="color:
rgb(0,128,0)"><i>ver</i></a></span></font></li> <li><font
color="#000000"><span style="font-family: Tahoma; font-size: 10px">Limites
Máximos de Resíduos de Produtos Fitofarmacêuticos em Portugal. <a
href="http://www.dgpc.min-agricultura.pt/fitofarmaceuticos/Residuos/LMR/LMR.
htm" target="_blank" style="color:
rgb(0,128,0)"><i>ver</i></a></span></font></li> </ul> </td>
</tr></table>'
singletext[6]='<table border="0" cellpadding="2" cellspacing="0"
width="100%"><tr> <td width="10%" valign="top" rowspan="2"><img
src="http://www.min-agricultura.pt/oportal/extcnt/docs/FOLDER/FLASH/IMAGENS/
fogo.jpg" alt="117 - NÚMERO DE ALERTA DE FOGOS FLORESTAIS"></td> <td
width="90%"><span style="font-family: Tahoma; font-size: 11px"><strong>117 -
NÚMERO DE ALERTA DE FOGOS FLORESTAIS</strong></span><span
style="font-family: Tahoma; font-size: 12px"> <br> </span><span
style="font-family: Tahoma; font-size: 10px">O alerta de um incêndio pode
ser dado para o número 117.<br> O informador deverá transmitir de uma
forma muito precisa e sintética as seguintes informações:</span></td>
</tr> <tr> <td width="90%"><ul style="color: rgb(0,128,0); text-align:
left" type="square"> <li><font color="#000000"><span
style="font-family: Tahoma; font-size: 10px">Localização aproximada
do incêndio;</span></font></li> <li><font color="#000000"><span
style="font-family: Tahoma; font-size: 10px">Estimativa da dimensão
do incêndio (se possível);</span></font></li> <li><font
color="#000000"><span style="font-family: Tahoma; font-size: 10px">Forma de
acesso mais rápido ao local. </span></font></li> </ul> </td>
</tr></table>'
//singletext[...]='...';
//-- end Parameters and message -->
//-- begin: Scroller's Algorithm -->
if (singletext.length>1)ii=1;else ii=0;
function goup(){if(sspeed!=rspeed*8){sspeed=sspeed*2;restart=sspeed;}}
function godown(){if(sspeed>rspeed){sspeed=sspeed/2;restart=sspeed;}}
function start(){if
(document.all){iens6div.style.top=sheight;iescroll(iens6div);}
else if
(document.layers){document.ns4div.document.ns4div1.top=sheight;document.ns4d
iv.document.ns4div1.visibility='show';ns4scroll(document.ns4div.document.ns4
div1);}
else if
(document.getElementById){document.getElementById('iens6div').style.top=shei
ght;ns6scroll(document.getElementById('iens6div'));}}
function iescroll(whichdiv){
iediv=eval(whichdiv);
sizeup=iediv.offsetHeight;
if(iediv.style.pixelTop>0&&iediv.style.pixelTop<=sspeed){
iediv.style.pixelTop=0;
// setTimeout("iescroll(iediv)",100);
}
if(iediv.style.pixelTop>=sizeup*-1){
iediv.style.pixelTop-=sspeed;
// setTimeout("iescroll(iediv)",100);
}
else {
iediv.style.pixelTop=sheight;
iediv.innerHTML=singletext[ii];
if(ii==singletext.length-1)ii=0;else ii++;
}
setTimeout("iescroll(iediv)",100);
}
function
ns4scroll(whichlayer){ns4layer=eval(whichlayer);sizeup=ns4layer.document.hei
ght;if(ns4layer.top>0&&ns4layer.top<=sspeed){ns4layer.top=0;setTimeout("ns4s
croll(ns4layer)",100);}if
(ns4layer.top>=sizeup*-1){ns4layer.top-=sspeed;setTimeout("ns4scroll(ns4laye
r)",100);}else{ns4layer.top=sheight;ns4layer.document.write(singletext[ii]);
ns4layer.document.close();if(ii==singletext.length-1)ii=0;else ii++;}}
function
ns6scroll(whichdiv){ns6div=eval(whichdiv);sizeup=ns6div.offsetHeight;if(pars
eInt(ns6div.style.top)>0&&parseInt(ns6div.style.top)<=sspeed){ns6div.style.t
op=0;setTimeout("ns6scroll(ns6div)",100);}if
(parseInt(ns6div.style.top)>=sizeup*-1){ns6div.style.top=parseInt(ns6div.sty
le.top)-sspeed;setTimeout("ns6scroll(ns6div)",100);}else{ns6div.style.top=sh
eight;ns6div.innerHTML=singletext[ii];if(ii==singletext.length-1)ii=0;else
ii++;}}
//-- end Algorithm -->
</script>
<!-- End of Script between <head> & </head> tags-->
</HEAD>
<!-- STEP III: Make sure start() is loaded -->
<BODY onLoad="start()">
<!-- STEP IV: Goes between <BODY ... > & </BODY> tags
begin: body code -->
<!-- You may remove last cell below (<td> ... </td>) to get rid of
Speed-change -->
<table align="center" border="0"><tr><td>
<script language="JavaScript">if(document.layers){document.write('<ilayer
id="ns4div" width='+swidth+' height='+sheight+' bgcolor='+sbcolor+'><layer
id="ns4div1" width='+swidth+' height='+sheight+' onmouseover="sspeed=0;"
onmouseout="sspeed=restart">');document.write(singletext[0]);document.write(
'</layer></ilayer>')}
if(document.getElementById||document.all){document.write('<div
style="position:relative;overflow:hidden;width:'+swidth+';height:'+sheight+'
;clip:rect(0 '+swidth+' '+sheight+' 0);background-color:'+sbcolor+';"
onmouseover="sspeed=0;" onmouseout="sspeed=restart"><div id="iens6div"
style="position:relative;width:'+swidth+';">');document.write(singletext[0])
;document.write('</div></div>');}</script>
</td></tr></table>
<!-- end -->
</body></html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top