questo è il codice
codice:<html> <head> <title>Scrolling news</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="/stili.css" rel="stylesheet" type="text/css"> </head> <BODY> <% cString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/database/cedab.mdb") 'set connession to database Set objConn=Server.CreateObject("ADODB.Connection") 'open connession to database objConn.Open cstring Set rs = Server.CreateObject("ADODB.Recordset") nometabella="news" ' inserisci qui il nome della tabella da vedere SQL = "select headline From "&nometabella&"" 'apro il rs rs.Open sql, objConn, 3, 3 'cursore dinamico stringa = "" do until rs.eof For Each campo in rs.Fields stringa = stringa & campo &" " next rs.movenext loop %> <script language="JavaScript1.2"> //Specify the marquee's width (in pixels) var marqueewidth=700 //Specify the marquee's height (in pixels, pertains only to NS) var marqueeheight=20 //Specify the marquee's scroll speed (larger is faster) var speed=6 //Specify the marquee contents var marqueecontents='<span class="testo"><%=stringa%></span>' if (document.all) document.write('<center><marquee scrollAmount='+speed+' style="width:'+marqueewidth+'">'+marqueecontents+'</marquee></center>') function regenerate(){ window.location.reload() } function regenerate2(){ if (document.layers){ setTimeout("window.onresize=regenerate",450) intializemarquee() } } function intializemarquee(){ document.cmarquee01.document.cmarquee02.document.write('<nobr>'+marqueecontents+'</nobr>') document.cmarquee01.document.cmarquee02.document.close() thelength=document.cmarquee01.document.cmarquee02.document.width scrollit() } function scrollit(){ if (document.cmarquee01.document.cmarquee02.left>=thelength*(-1)){ document.cmarquee01.document.cmarquee02.left-=speed setTimeout("scrollit()",100) } else{ document.cmarquee01.document.cmarquee02.left=marqueewidth scrollit() } } window.onload=regenerate2 </script> <ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01"> <layer name="cmarquee02"></layer> </ilayer> <% rs.close set rs=nothing 'chiudo tutto objConn.close set objconn=nothing %> </body> </html>

Rispondi quotando