Visualizzazione dei risultati da 1 a 5 su 5

Discussione: Pop Up

  1. #1

    Pop Up

    Ciao ragazzi qualcuno potrebbe postarmi il codice per creare link che eseguono un popup?

    vi ringrazio anticipatamente
    Rispondetemi.

  2. #2

  3. #3
    Inserisci questa istruzione nella pagina e nel punto in cui devi mettere il link:
    codice:
    <font face="Verdana" size="1">
    qui scrivi quello che vuoi per il link</font>
    <script language="javascript" type="text/javascript">
    <!--
    function finestra(){
    x=window.open('nome_pagina.asp', '','width=350,height=320,resizable=1,scrollbars=0,menubar=0,toolbar=0,status=0,location=0');
    }
    //-->
    
                    </script>
    In questo: nome_pagina.asp
    è la pagina che ti devi creare e che verrà visualizzata come popup delle dimensioni di 350 di larghezza e 320 di altezza (valori che puoi variare come ti pare). Mettendo al posto degli 0 un 1 puoi decidere se mettere (1) o no (0) le scrollbars o il menu ecc...

  4. #4
    Io ho provato ad usare quello script ma non mi marica le pagine in modo corretto, ovvero non mi carica gli stili.
    Come Mai? colpa mia o di java

  5. #5
    Per rimanere in tema di asp ti do questo script asp che serve a creare lo script per le popup. Per inciso, carica anche i css.
    codice:
    <center><font face="Verdana" color="#000080" size="3"><%
    If Request.Form("inviato") = "si" then
    'Il form è stato inviato
    'Creo le variabili e prendo i valori dei campi
    '------------------------------------------------
    'Nome variabile
    Dim strVariabile
    strVariabile = Request.Form("variabile")
    if strVariabile = "" or isNumeric(strVariabile) = true then strVariabile = "x" 
    'Url
    Dim strUrl
    strUrl = Request.Form("url")
    if strUrl = "" then strUrl = "http://www.aspcode.it"
    
    'Caratteristiche
    Dim strLarghezza, strAltezza, strRedimensionabile
    Dim strScroll, strMenu, strTool, strMenus, strIndirizzo
    strLarghezza = Request.Form("larghezza")
    if strLarghezza = "" or isnumeric(strLarghezza) = false then strLarghezza = "350"
    
    strAltezza = Cstr(Request.Form("altezza"))
    if strAltezza = "" or isnumeric(strAltezza) = false then strAltezza = "350"
    
    strRedimensionabile = Request.Form("redimensionabile")
    if strRedimensionabile = "" then strRedimensionabile = "0"
    
    strScroll = Request.Form("scroll")
    if strScroll = "" then strScroll = "0"
    
    strMenus = Request.Form("menu")
    if strMenus = "" then strMenus = "0"
    
    strTool = Request.Form("tool")
    if strTool = "" then strTool = "0"
    
    strStatus = Request.Form("status")
    if strStatus = "" then strStatus = "0"
    
    strIndirizzo = Request.Form("indirizzo")
    if strIndirizzo = "" then strIndirizzo = "0"
    
    'Creo il javascript
    Dim strJs
    strJs = "function finestra(){"& chr(10) &_
    strVariabile &"=window.open('"& strUrl &"', "&_
    "'','" &_
    "width="& strLarghezza &","&_
    "height="& strAltezza &","&_
    "resizable="& strRedimensionabile &","&_
    "scrollbars="& strScroll &","&_
    "menubar="& strMenus &","&_
    "toolbar="& strTool &","&_
    "status="& strStatus &","&_
    "location="& strIndirizzo &_
    "');"& chr(10) &"}"
    
    'Output all'utente...
    
    else
    'se il form non è stato inviato allora mostro all'utente l'intestazione del form
    Response.write("Crea pop-up personalizzate con pochi click!")
    end if
    %></font></center>
    
    <script language="javascript" type="text/javascript">
    <!--
    <%=strJs%>
    //-->
    </script>
    <p align="center">
    <font face="Verdana" size="2">
    <font color="#000080">Clicca qui</font><font color="#000080"> per vedere la finestra!</font><font color="#000080">
    Ecco il codice javascript:</font></font>
    
    </p>
    <div align="center"> &lt;script language="javascript"&gt;
    
    <textarea rows="7" cols="55"><%=strJs%></textarea>
    
    
    &lt;/script&gt;</div>
    
    <form name="popup" method="POST" action="crea_popup.asp"><input type="hidden" name="inviato" value="si">
    [list=1]
     
    <div align="center">
      <center>
     
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="48%" height="271">
      <tr>
        <td width="136%" colspan="4" height="20">
        <p align="center"><font face="Verdana"> <font size="1">1 - Informazioni varie:</font></font></td>
      </tr>
      <tr>
        <td width="8%" height="22"></td>
        <td width="20%" align="right" height="22"><font face="Verdana" size="1">Nome variabile (es. x):</font></td>
        <td width="113%" colspan="2" height="22">
        <p align="left"><font face="Verdana" size="1"> 
    <input type="text" name="variabile" value="<%=strVariabile%>" size="12"></font></td>
      </tr>
      <tr>
        <td width="8%" height="24"></td>
        <td width="20%" align="right" height="24"><font face="Verdana" size="1">Url finestra (della pagina che 
        diventerà popup):</font></td>
        <td width="111%" colspan="2" height="24"><font face="Verdana" size="1"> 
    <input type="text" name="url" value="<%=strUrl%>" size="31"></font></td>
      </tr>
      <tr>
        <td width="136%" colspan="4" height="21">
        <p align="center"><font face="Verdana"> <font size="1">2 - Dimensioni:</font></font></td>
      </tr>
      <tr>
        <td width="8%" height="22"></td>
        <td width="20%" align="right" height="22"><font face="Verdana" size="1">Larghezza:</font></td>
        <td width="113%" colspan="2" height="22"><font face="Verdana" size="1"> 
    <input type="text" name="larghezza" value="<%=strLarghezza%>" size="12"> 
        in
    pixel</font></td>
      </tr>
      <tr>
        <td width="8%" height="22"></td>
        <td width="20%" align="right" height="22"><font face="Verdana" size="1">Altezza:</font></td>
        <td width="113%" colspan="2" height="22"><font face="Verdana" size="1"> 
    <input type="text" name="altezza" value="<%=strAltezza%>" size="12"> in
    pixel </font></td>
      </tr>
      <tr>
        <td width="136%" colspan="4" height="20">
        <p align="center"><font face="Verdana" size="1">3 - Opzioni</font></td>
      </tr>
      <tr>
        <td width="1%" height="20"></td>
        <td width="36%" align="right" height="20"><font face="Verdana" size="1">Ridimensionabile:</font></td>
        <td width="10%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="redimensionabile" value="1"<% if strRedimensionabile = "1" then %> checked <% End if %>>
    Si</font></td>
        <td width="112%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="redimensionabile" value="0"<% if strRedimensionabile = "0" then %> <% End if %>>
    No</font></td>
      </tr>
      <tr>
        <td width="1%" height="20"></td>
        <td width="36%" align="right" height="20"><font face="Verdana" size="1">Barre di scorrimento:</font></td>
        <td width="10%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="scroll" value="1"<% if strScroll = "1" then %> checked <% End if %>>
    Si</font></td>
        <td width="112%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="scroll" value="0"<% if strScroll = "0" then %> <% End if %>>
    No </font></td>
      </tr>
      <tr>
        <td width="1%" height="20"></td>
        <td width="36%" align="right" height="20"><font face="Verdana" size="1">Menu:</font></td>
        <td width="10%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="menu" value="1"<% if strMenus = "1" then %> checked <% End if %>>
    Si</font></td>
        <td width="112%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="menu" value="0"<% if strMenus = "0" then %> <% End if %>>
    No</font></td>
      </tr>
      <tr>
        <td width="1%" height="20"></td>
        <td width="36%" align="right" height="20"><font face="Verdana" size="1">Barra degli strumenti:</font></td>
        <td width="10%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="tool" value="1"<% if strTool = "1" then %> checked <% End if %>>
    Si</font></td>
        <td width="112%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="tool" value="0"<% if strTool = "0" then %> <% End if %>>
    No </font></td>
      </tr>
      <tr>
        <td width="1%" height="20"></td>
        <td width="36%" align="right" height="20"><font face="Verdana" size="1">Barra di stato:</font></td>
        <td width="10%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="status" value="1"<% if strStatus = "1" then %> checked <% End if %>>
    Si</font></td>
        <td width="112%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="status" value="0"<% if strStatus = "0" then %> <% End if %>>
    No </font></td>
      </tr>
      <tr>
        <td width="1%" height="20"></td>
        <td width="36%" align="right" height="20"><font face="Verdana" size="1">Barra dell'indirizzo:</font></td>
        <td width="10%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="indirizzo" value="1"<% if strIndirizzo = "1" then %> checked <% End if %>>
    Si</font></td>
        <td width="112%" height="20"><font face="Verdana" size="1"> 
    <input type="radio" name="indirizzo" value="0"<% if strIndirizzo = "0" then %> <% End if %>> 
        No</font></td>
      </tr>
    </table>
     
      </center>
    </div>
     
      <p align="center"><input type="submit" value="Invia › ›"> <input type="reset" value="Reset">
      </p>
    </form>
    Salvalo con il nome "crea_popup.asp" altrimenti non ti funziona.
    Fai sapere!
    Ciauz!

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 © 2026 vBulletin Solutions, Inc. All rights reserved.