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

    dimensioanre una finestra dinamicamente

    devo caricare un'immagine dentro una finestra e tale finestra deve essere dimensionata dinamicamente in relazione all'immagine che viene caricata...e' possibile fare cio'?

  2. #2
    certo.

    cerca sul forum, o su HTML o su SCRIPTING, se ne è parlato
    2 giorni fa

    DYNAMIC+ [ E-mail ]

    Secondo me non si può fare!

  3. #3

    Ecco lo script...

    codice:
      <html>
    
        <head>
          <script type="text/javascript" language="JavaScript">
          <!--
    
            function showImage( __imagePath )
            {
              var _hImage     = new Image( );
    
              _hImage.onerror = function( )
              {
                alert( "The image \"" + __imagePath + "\" does not exist." );
              }
    
              _hImage.onabort = function( )
              {
                alert( "The image \"" + __imagePath + "\" cannot be downloaded." );
              }
    
              _hImage.onload  = function( )
              {
                var _cx  = _hImage.width;
                var _cy  = _hImage.height;
    
                var _x   = (screen.width  - _cx) / 2;
                var _y   = (screen.height - _cy) / 2;
    
                var _wnd = window.open( "", "_blank", "width="    + _cx +
                                                      ",height="  + _cy +
                                                      ",left="    + _x +
                                                      ",top="     + _y +
                                                      ",screenX=" + _x +
                                                      ",screenY=" + _y +
                                                      ",menubar=0,toolbar=0,directories=0" +
                                                      ",resizable=0,status=0,scrollbars=0" );
    
                _wnd.document.open( "text/html" );
    
                _wnd.document.write( "<html>" );
                _wnd.document.write( "<head><title>Image Preview by DYNAMIC+</title></head>" );
                _wnd.document.write( "<body topmargin=\"0\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">" );
                _wnd.document.write( "<img src=\"" + __imagePath + "\" /></body>" );
                _wnd.document.write( "</html>" );
    
                _wnd.document.close( );
                _wnd.focus( );
              }
    
              _hImage.src     = __imagePath;
            }
    
          //-->
          </script>
        </head>
    
        <body>
          Mostra logo di Google.it
    
          Mostra logo di Html.it
    
          Mostra un bel BigMac
    
        </body>
    
      </html>
    Lo trovi anche qua (se ne è parlato): http://forum.html.it/forum/showthrea...hreadid=768559
    DYNAMIC+ [ E-mail ]

    Secondo me non si può fare!

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.