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

    APRIRE IMMAGINE DIMENSIONI REALI

    Salve ragazzi

    utilizzo questa forma per visualizzare l'immagine in miniatura:
    [img]<%=rsnews([/img]" width="60" height="50" border="0">
    foto1 è uno dei campi del database.

    è possibile cliccando sull'immagine che viene visualizzata da : [img]<%=rsnews([/img] aprirla nelle dimensioni originali tramite un popup?

    grazie
    Mara

  2. #2
    Nella pagina principale metti un link relativo all'immagine:

    <a href="#" onClick="javascript:PopUpImg('popup.asp?id_img=<%= Rsnews("ID_img")%>')">

    Mentre nella pagina popup metti:
    codice:
    <%
    ID = request.querystring("id_img")
       Set Rsnews = Server.CreateObject("ADODB.Recordset")
       Sql = "SELECT * FROM dbImg WHERE ID_img = "&ID&""
       Rsnews.Open Sql, Conn 
    %>
    <div align="center">[img]Path_Img\<%=Rsnews([/img]"></div>
    Naturalmente nella pagina popup, nel tag img, non metti le dimensioni dell'immagini che verranno impostate automaticamente

  3. #3
    ciao, grazie per la risposta!
    non funziona! ho scritto questo nel popup

    codice:
    <%
    ID = request.querystring("news")
       Set Rsnews = Server.CreateObject("ADODB.Recordset")
       Sql = "SELECT * FROM news WHERE foto1 = "&ID&""
       Rsnews.Open Sql, Conn 
    %>
    e nella pagina principale, nel collegamento della foto questo:

    codice:
    script:PopUpImg('popup.asp?id_img=<%=Rsnews("foto1")%>')">
    ma non si vede nulla!

    PS: io utilizzo 5 immagini per record, perciò ci saranno 5 popup ?

  4. #4
    per prima cosa devi prendere lo script della popup:
    Tra gli <head> metti:
    codice:
    <script type="text/javascript"> 
    function PopUpImg(url) { 
    newin = window.open(url,'titolo','scrollbars=no,resizable=yes, width=200,height=200,status=no,location=no,toolbar=no');
    } 
    </script>
    mentre sul link:
    codice:
    <a href="javascript:PopUpImg('popup.asp?id=<%=rsnews("ID_foto")%>);">
    [img]<%=rsnews([/img]" width="60" height="50" border="0"></a>
    mentre nella pagine popup.asp:
    codice:
    ID = request.querystring("news")
       Set Rsnews = Server.CreateObject("ADODB.Recordset")
       Sql = "SELECT * FROM news WHERE foto1 = "&ID&""
       Rsnews.Open Sql, Conn
    Naturalmente i campi "Id_foto", ecc.., sono di mia invenzione per farti capire tu devi sostituirli con quelli del tuo Database

    Nella stringa Sql WHERE devi mette il nome del campo contatore

    spero di essere stato più chiaro. altrimenti sono qui

  5. #5
    esiste una procedura più semplice senza dover creare tutte le pagine popup?
    giusto un collegamento che preleva il link dal database e mi apre la foto in un altra pagina con le dimensioni originali?
    se vuoi ti allego il codice della pagina
    grazie

  6. #6
    è proprio quello che ti sto dicendo io....guarda se hai un po' di pazienza te la creo io

  7. #7
    te ne sarei grata davvero!
    ti allego il codice che ho già
    grazie mille!

    codice:
    <script language="javascript">
    function visualizzaFoto(foto) {
       window.open("dettaglioFoto.asp?foto="+foto,"name","  toolbar=no,directories=no,menubar=no,wid
     th=265,height=277,top=100,left=150,resiz
    able=no,scrollbars=yes");
    }
    </script>
    <%
    
    %>
    <html>
    <head>
    
    <title>LISTA NEWS</title>
    
    <link rel="stylesheet" href="../vendita_trilocali/setting.css" type="text/css">
    <style type="text/css">
    <!--
    .Stile2 {font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif;}
    .Stile3 {color: #999999}
    .Stile4 {font-size: 10px}
    .Stile5 {font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; }
    body,td,th {
    	color: #000000;
    }
    a:link {
    	color: #0000FF;
    }
    a:visited {
    	color: #0000FF;
    }
    a:hover {
    	color: #000000;
    }
    a:active {
    	color: #0000FF;
    }
    -->
    </style>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
    <body>
    <p align="center">
      <%
    dim cns
    set cns = server.createobject("ADODB.Connection")
    cns.open "DRIVER={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("/mdb-database/vendita_trilocali.mdb")
    
    dim rsnews, sqlnewws
    set rsnews = server.createobject("ADODB.RecordSet")
    sqlnewws = "SELECT * FROM news ORDER BY data2 DESC"
    rsnews.open sqlnewws, cns, 3, 3
    
    if rsnews.eof then
    %>
    
      
    
    </p>
    <p align="center"><font size="2" face="Verdana"> Nessun immobile al momento</font>
      <%
    else
    
    do while not rsnews.eof
    %>
    
    
    <table width="670" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="100" height="20" valign="middle"><span class="Stile4"><font face="verdana">Localit&agrave;:</font></span></td>
        <td width="490" valign="top" class="Stile2"><font face="verdana" size="2">
          <% = rsnews("titolo") %>
        </font></td>
      </tr>
      <tr>
        <td height="20" valign="middle" class="Stile5">Descrizione:</td>
        <td valign="top" class="Stile2"><font face="verdana" size="2">
          <% = rsnews("testo") %>
        </font></td>
      </tr>
      <tr>
        <td colspan="2"></td>
      </tr>
      <tr>
        <td valign="middle">      
          <span class="Stile5"><font face="verdana">Immagini:</font></span></td>
        <td valign="top"> 
    <% if (rsnews("foto1") = "" or not isnull(rsnews("foto1"))) and _
          (rsnews("foto2") = "" or not isnull(rsnews("foto2"))) and _
          (rsnews("foto3") = "" or not isnull(rsnews("foto3"))) and _
          (rsnews("foto4") = "" or not isnull(rsnews("foto4"))) and _
          (rsnews("foto5") = "" or not isnull(rsnews("foto5"))) then %>
       <span class="Stile5"><font face="verdana" size="2">');">[img]<%=rsnews([/img]" width="60" height="50" border=0> ');">[img]<%=rsnews([/img]" width="60" height="50" border=0> ');">[img]<%=rsnews([/img]" width="60" height="50" border=0> ');">[img]<%=rsnews([/img]" width="60" height="50" border=0> ');">[img]<%=rsnews([/img]" width="60" height="50" border=0> [img]no_foto.jpg[/img]</font></span></td> 
       <td><font face="verdana" size="2"></font>
    <% else %>
       <td>
    <% end if %>
    </td>    </tr>
      <tr>
        <td colspan="2"><span class="Stile3">___________________________________________________________</span></td>
      </tr>
    </table>
    
    </center>
    </div>
    
    <%
    rsnews.movenext
    loop
    
    end if
    %> 
    </body>
    </html>

  8. #8
    mandami la tua email tramite messaggio privato così ti invio le pagine

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.