Salve ho costruito uno scroller verticale che mi visualizza le news all'interno del quale ho inserito del codice asp per richiamare all'interno dello scroller le news che andrò ad aggiornare in dinamico, ho un problema, dovrei far aprire cliccando sull'immagine, una finestra popup ma non ci riesco, di seguito inserisco il codice che sto usando:
Codice per la finestra poup:
<script type="text/javascript">
var stile = "top=10, left=10, width=250, height=200, status=no, menubar=no, toolbar=no scrollbar=no";
function Popup(apri) {
window.open(apri, "", stile);
}
</script>
Codice per lo scroller, la riga incriminata è marcata in grassetto
<script language="JavaScript1.2">
var marqueewidth="200px"
var marqueeheight="80px"
var marqueespeed=1
var pauseit=3
var marqueecontent='<%
xDb_Conn_Str = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("miodb.mdb") & ";"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str
strsql = "SELECT * FROM [tabella] Order by id desc"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strsql, conn, 3, 3
for i=1 to 10
if rs.eof<>true and rs.bof<>true then %><table cellspading="0" cellspacing="0" border="0" width="80%" class="td21"><tr><td width="0">">[/B] <% If Not IsNull (rs("Immagine")) Then %>[img]news/news_Immagine_bv.asp?key=<%= rs([/img]" border=0 width=70 height=70 hspace="2"><% End If %></td><td width="100%" align="center" valign="top">"><% Response.Write (rs("titolo"))%>
<div align="right"><font class="font111"><%= Date()%></font></div></tr></td><tr><td colspan="2" height="16"></td></tr><tr><td colspan="2" height="4" background="immagini/tratto.gif"></td></tr><tr><td colspan="2" height="16"></td></tr><%
rs.movenext
end if
next%></table>'
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
var actualheight=''
var cross_marquee, ns_marquee
function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.top=parseInt(marqueeheight)+8+ "px"
cross_marquee.innerHTML=marqueecontent
actualheight=cross_marquee.offsetHeight
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee 2
ns_marquee.top=parseInt(marqueeheight)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualheight=ns_marquee.document.height
}
lefttime=setInterval("scrollmarquee()",20)
}
window.onload=populate
function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
cross_marquee.style.top=parseInt(cross_marquee.sty le.top)-copyspeed+"px"
else
cross_marquee.style.top=parseInt(marqueeheight)+8+ "px"
}
else if (document.layers){
if (ns_marquee.top>(actualheight*(-1)+8))
ns_marquee.top-=copyspeed
else
ns_marquee.top=parseInt(marqueeheight)+8
}
}
if (iedom||document.layers){
with (document){
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';he ight:'+marqueeheight+';overflow:hidden" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
write('<div id="iemarquee" style="position:absolute;left:0px;top:0px;width:10 0%;">')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee">')
write('<layer name="ns_marquee2" width='+marqueewidth+' height='+marqueeheight+' left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')
}
}
}
</script>
<%
rs.close
set rs=Nothing
set Conn=Nothing
%>
Spero di essermi spiegato bene
Un grazie in anticipo![]()

Rispondi quotando