Ciao a tutti,
calcolando che uso questo codice per sviluppare lo script del testo scorrevole e la relativa "pescata" di dati da DB MySql:
codice:
<script language="JavaScript">
var max=0;
function textlist()
{
max=textlist.arguments.length;
for (i=0; i<max; i++)
this[i]=textlist.arguments[i];
}
tl=new textlist
(
<%
Set newsRS = Server.CreateObject( "ADODB.Recordset" )
newsRS.ActiveConnection = Con
sqlString = "SELECT newsbar_testo FROM newsbar"
newsRS.Open sqlString
primo = true
while not newsRS.EOF
if not primo then Response.Write ", "
primo = false
Response.Write """" & newsRS("newsbar_testo") & """"
newsRS.MoveNext
wend
newsRS.Close
%>
);
var x=0; pos=0;
var l=tl[0].length;
function textticker()
{
document.getElementById('ticktd').innerHTML=tl[x].substring(0,pos);
if(pos++==l) { pos=0; setTimeout("textticker()",2000); x++;
if(x==max) x=0; l=tl[x].length; } else
setTimeout("textticker()",120);
}
</script>
e poi lo richiamo dentro la pagina con:
codice:
<td id="ticktd" width="60%">
</td>
Vorrei che ognuno di questi testi sia un <a href="newsbar_link"> ovvero che mi linki ad un collegamento che io specificherò nel DB con newsbar_link.
Mi spiegate come fare?