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

    cambio immagine in base al browser

    c'è un javascript x far modificare un'immagine in base al tipo di browser utilizzato?

  2. #2
    Utente di HTML.it L'avatar di v2v2
    Registrato dal
    Sep 2002
    Messaggi
    221
    Potresti provare questo codice ma non ti assicuro niente perchè
    avendo solo IE non posso provarlo
    codice:
    <html>
    <head>
    <script> 
    var idd="img1";
    
    if (document.layers){ // Netscape 4.x 
    document.getElementById(idd).src='imgN4.jpg'; 
    } 
    else if((OPER>-1)) { // Opera 
    document.getElementById(idd).src='imgOp.jpg'; 
    } 
    else if (document.all){ // Explorer 
    document.getElementById(idd).src='imgIE.jpg'; 
    } 
    else if (document.getElementById){ // Netscape 6.x 
    document.getElementById(idd).src='imgN6.jpg'; 
    } 
    </script> 
    </head>
    <body> 
    [img]img.jpg[/img]
    </body>
    </html>
    Only the good die young
    all the evil seem to live forever

    :metallica

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