Visualizzazione dei risultati da 1 a 6 su 6

Discussione: Galleria

  1. #1

    Galleria

    Ciao
    ho un probblema con uno script.
    Non funziona, probabilmente dovrei mettere il codice all'interno delle stesso div, ma non è possibbile perchè il riferimento mi serve altrove.

    questo è il codice:
    codice:
    <script type="text/javascript" language="javascript">
    function showPic (whichpic) { 
    	if (document.getElementById) { 
    		document.getElementById('placeholder').src = whichpic.href; 
    		if (whichpic.title) { 
    			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title; 
    		} else { 
    			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
    		} 
    		return false; 
    	} else { 
    		return true; 
    	} 
    }
    </script>
    questo è il collegamento nel body dove richiamo le immagini
    questo è dove lo visualizzo:
    codice:
    <p id="desc"></p>
    <img id="placeholder" /><
    vi posto anche il codice intero della pagina
    codice:
    <script type="text/javascript" language="javascript">
    function showPic (whichpic) { 
    	if (document.getElementById) { 
    		document.getElementById('placeholder').src = whichpic.href; 
    		if (whichpic.title) { 
    			document.getElementById('desc').childNodes[0].nodeValue = whichpic.title; 
    		} else { 
    			document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue; 
    		} 
    		return false; 
    	} else { 
    		return true; 
    	} 
    }
    </script>
    
    </head>
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    
    <table width="901" height="526" border="0" align="center" cellpadding="0" class="bordo" cellspacing="0" id="Table_01">
    	<tr>
    		<td width="901" height="110"></td>
    	</tr>
    	<tr>
    	  <td align="center" valign="middle" >
    		
    
    
    </td>
    	</tr>
    	<tr>
    		<td width="901" height="385"><table width="888" height="367" border="0">
              <tr>
                <td width="116" align="center" valign="top">
    			
    			
    
    [img]images/1-P5230001.jpg[/img]
    [img]images/1-P5230004.jpg[/img]
    [img]images/1-P5230008.jpg[/img]
    [img]images/1-P5230011.jpg[/img]
    
    
    </td>
                <td width="405" align="center" valign="top"></td>
                <td width="353" align="center" valign="top">
    			  
    			  <p id="desc"></p>
    <img id="placeholder" /></td>
              </tr>
            </table></td>
              </tr>
             
             
    	  
    
    <table width="896" border="0">
              <tr>
                <td height="39" class="galleria1 row_bord">pag. 1 - 20 </td>
                <td width="145" class="pagine row_bord">pag. 1,2,3,4,&gt;&gt; </td>
              </tr>
            </table></p></td>
    	</tr>
    	  <tr>
          <td valign="middle" colspan="2" background="images/last.jpg" height="20" style="color: #652200" align="right">td>
        </tr>
    </table>
    
    </body>
    </html>
    Grazie
    elena

  2. #2
    Utente di HTML.it L'avatar di Igreo
    Registrato dal
    Jun 2004
    Messaggi
    1,114
    Sempre se gli amministratori non mi fucilano.. prova così:

    function showPic (whichpic) {
    if (document.getElementById) {
    if (document.getElementById('placeholder')) document.getElementById('placeholder').src = whichpic.href; //HO MODIFICATO QUI!
    if (whichpic.title) {
    document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
    } else {
    document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
    }
    return false;
    } else {
    return true;
    }
    }

  3. #3
    non funiona neanche così.

    quado clicco sull'immagine invece di aprirsi nello spazio che ho scelto, si apre in un'altra finestra.

    qualche altro suggermento.....?

    la pagina la potete trovare qui: www.rosablue.it/prova/mobili-800/mag07.html

  4. #4
    Utente di HTML.it L'avatar di Igreo
    Registrato dal
    Jun 2004
    Messaggi
    1,114
    Correggi queste righe così:


    [img]images/1-P5230001.jpg[/img]


    Praticamente devi mettere l'url dentro la funzione e invece l'href lo devi disabilitare con una funzione nulla!

    CIAO!

  5. #5
    niente....
    con questo codice quando clicco non si apre più nente come se non ci fosse nessun collegamnto.


  6. #6
    Utente di HTML.it L'avatar di Igreo
    Registrato dal
    Jun 2004
    Messaggi
    1,114
    Originariamente inviato da Igreo
    Sempre se gli amministratori non mi fucilano.. prova così:

    function showPic (whichpic) {
    if (document.getElementById) {
    if (document.getElementById('placeholder')) document.getElementById('placeholder').src = whichpic; //HO MODIFICATO QUI!
    if (whichpic.title) {
    document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
    } else {
    document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
    }
    return false;
    } else {
    return true;
    }
    }
    C'era un href di troppo!

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.