• Home
  • Forum
  • Fare Web
  • Javascript

pop-up immagina a dimensione automatica

  • Creatore Discussione Creatore Discussione z.cristiano
  • Data di inizio Data di inizio 16 Giu 2007
Z

z.cristiano

Utente Attivo
16 Giu 2007
145
0
16
  • 16 Giu 2007
  • #1
Ciao a tutti...
Mi serve un vostro aiuto ed è strano...
Ho preso il codice javascript tramite dal sito html.it

<script>

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
writeln('width=100-(document.body.clientWidth-document.images[0].width);');
writeln('height=100-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();
}}

</script>

<a href="javascriptopImage('01.gif','titolo')">Clicca qui</a>

E su Internet Explorer e FireFox funziona bene, ma su Internet Explorer 7 visualizza l'immagine tagliata, ma perchè?

Chi di voi mi può aiutare a risolvere questo solo piccolissimo problema?
O magari chi di voi conosce un'altro tipo di codice che funzioni su tutti i tipi di browser?

Grazie..
Cristiano
 
Devi accedere o registrarti per poter rispondere.

Discussioni simili

W
  • Bloccata
Aprire un pop-up da un pop-up
  • wuolfit
  • 30 Set 2020
  • HTML e CSS
Risposte
3
Visite
1K
HTML e CSS 1 Ott 2020
Max 1
A
[Javascript] Pop-up di avviso "Aggiungi nomepagina alla schermata home"
  • Alessandro80
  • 5 Feb 2019
  • Javascript
Risposte
1
Visite
2K
Javascript 18 Feb 2019
IKOULA CLOUD
[Javascript]Barra di aggiornamento in pop pup
  • Monital
  • 1 Set 2016
  • Javascript
Risposte
1
Visite
2K
Javascript 4 Set 2016
Monital
iTunes e iPop nano: sincronizzare una cartella
  • felino
  • 17 Giu 2015
  • Mac e Software
Risposte
0
Visite
2K
Mac e Software 17 Giu 2015
felino
P
Pop up centrata
  • pinuccio
  • 5 Giu 2015
  • Javascript
Risposte
1
Visite
2K
Javascript 6 Giu 2015
criric
A
pop up come modificare il posizionamento e il tempo
  • Apprendistastregone
  • 26 Mag 2015
  • HTML e CSS
Risposte
3
Visite
1K
HTML e CSS 27 Mag 2015
Apprendistastregone
A
N
Mostrare valori databse in un modal pop up con PHP e MySQL
  • newOne
  • 17 Apr 2014
  • PHP
Risposte
5
Visite
3K
PHP 18 Apr 2014
newOne
N
J
Forum php con pop ajax che dice che sono offline
  • Jakub Lemiszewski
  • 31 Mar 2014
  • PHP
Risposte
0
Visite
1K
PHP 31 Mar 2014
Jakub Lemiszewski
J
A
box con scrollbar in un pop-up
  • alessandromonti
  • 8 Dic 2012
  • jQuery
Risposte
0
Visite
2K
jQuery 8 Dic 2012
alessandromonti
A
A
Codice html per finestra pop up per blogger
  • andreafi
  • 5 Lug 2012
  • WordPress
Risposte
1
Visite
3K
WordPress 5 Lug 2012
alessandro1997
Due pop up sulla stess finestra
  • Monital
  • 13 Dic 2011
  • PHP
Risposte
3
Visite
1K
PHP 15 Dic 2011
Longo8
CREARE FINESTRA POP UP con scritta "x chiudi"...AIUTOO!
  • giancadeejay
  • 4 Gen 2011
  • Javascript
Risposte
9
Visite
18K
Javascript 24 Gen 2011
giancadeejay
P
Aprire più pop up in sequenza
  • peppepegasus
  • 24 Dic 2010
  • Javascript
Risposte
0
Visite
2K
Javascript 24 Dic 2010
peppepegasus
P
Pop-up antiblocco
  • giancadeejay
  • 12 Dic 2010
  • Flash
Risposte
0
Visite
2K
Flash 12 Dic 2010
giancadeejay
P
Compro PopUnder o Pop
  • publi
  • 20 Lug 2010
  • Vendere e Acquistare pubblicita' online
Risposte
1
Visite
2K
Vendere e Acquistare pubblicita' online 31 Ott 2017
business77
B
G
pop up div
  • gasparroa
  • 28 Mag 2010
  • Javascript
Risposte
0
Visite
1K
Javascript 28 Mag 2010
gasparroa
G
E
Problemi pop up
  • ermes79
  • 26 Mar 2010
  • Flash
Risposte
1
Visite
2K
Flash 26 Mar 2010
alessandro1997
N
Problema pop up di pagina asp
  • noemikat
  • 5 Set 2009
  • Flash
Risposte
0
Visite
1K
Flash 5 Set 2009
noemikat
N
M
Apertura pop up pagina internet explorer favorit
  • mathew83
  • 11 Giu 2009
  • Sicurezza e Virus
Risposte
1
Visite
5K
Sicurezza e Virus 11 Giu 2009
lotus
L
I
invio email con POP
  • ibngabril
  • 27 Gen 2009
  • Web Server
Risposte
2
Visite
2K
Web Server 5 Feb 2009
catellostefano
Condividi:
Facebook X (Twitter) LinkedIn WhatsApp e-mail Condividi Link
  • Home
  • Forum
  • Fare Web
  • Javascript
  • Italiano
  • Termini e condizioni d'uso del sito
  • Policy Privacy
  • Aiuto
  • Home
Community platform by XenForo® © 2010-2024 XenForo Ltd. | Traduzione a cura di XenForo Italia
Menu
Accedi

Registrati

  • Home
  • Forum
    • Nuovi Messaggi
    • Cerca...
  • Novità
    • Featured content
    • Nuovi Messaggi
    • Ultime Attività
X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?

X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?