Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    Inserire link in slide show

    Ciao a tutti,
    ho uno slide show di immagini che pesca da DB e funziona in questo modo:

    codice:
    <script type="text/javascript" language="JavaScript">
    <!--
    var slideShowSpeed = 2000
    
    var crossFadeDuration = 3
    
    var Pic = new Array()
    var Pix = new Array()
    <%
    dbname = Server.Mappath("ecommerce/dbprodotti.mdb")
    ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & dbname
    Set MyConn = Server.CreateObject("ADODB.Connection")
    Set DBConn = Server.CreateObject("ADODB.Connection")
    Set rs = Server.CreateObject("ADODB.Recordset")
    MyConn.Open ConnectionString, "", ""
    DBConn.Open MyConn
    SQL = "SELECT distinct img_small, id, nome_1 FROM prodotti where ordinamento_1 <> '' ORDER BY nome_1 asc"
    				Rs.Open SQL, DBConn, 1, 1
    				i = 0
    				while not rs.eof
    				fotografia = (rs("Img_small"))
    				id=(rs("id"))
    %>
    
    Pic[<%=i%>] = 'ecommerce/immagini/grandi/<%=fotografia%>'
    pic_lnk[<%=i%>] = 'ecommerce/dettaglio.asp?id=<%=id%>'
    <%
    rs.movenext
    i=i+1
    wend
    rs.close
    set rs=nothing
    myconn.close
    set myconn = nothing
    dbconn.close
    set dbconn = nothing
    %>
    
    var t
    var j = 0
    var y = 0
    var p = Pic.length
    
    var preLoad = new Array()
    for (i = 0; i < p; i++){
       preLoad[i] = new Image()
       preLoad[i].src = Pic[i]
    }
    var preLoadx = new Array()
    for (m = 0; m < p; m++){
       preLoadx[m] = new Image()
       preLoadx[m].src = Pix[m]
    }
    
    function runSlideShow(){
       if (document.all){
          document.images.SlideShow.style.filter="blendTrans(duration=2)"
          document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
          document.images.SlideShow.filters.blendTrans.Apply()
       }
       document.images.SlideShow.src = preLoad[j].src
       if (document.all){
          document.images.SlideShow.filters.blendTrans.Play()
       }
       j = j + 1
       if (j > (p-1)) j=0
       t = setTimeout('runSlideShow()', slideShowSpeed)
    }
    //-->
    </script>
    Ora avrei bisogno di associare ad ogni immagine un link.
    Quindi estraggo il link di ogni immagine in questo modo
    codice:
    pic_lnk[<%=i%>] = 'ecommerce/dettaglio.asp?id=<%=id%>'
    E fin qui va bene.
    Ma poi come faccio a farglielo mettere nell'herf dell'immagine?

    Ecco il codice dell'immagine con il suo link
    Grazie mille in anticipo a chi vorrà aiutarmi
    Paolo Monge
    Full Stack Web Developer & Strategist
    Come Nasce Un'idea

  2. #2
    Per favore, se qualcno sa mi dia una mano
    Grazie
    Paolo Monge
    Full Stack Web Developer & Strategist
    Come Nasce Un'idea

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.