Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

pb affichage img dans Ie

3 réponses
Avatar
Luc
Bonjour, à tous,

j'ai un gros problème d'affichage sous ie grrrr j'ouvre une pop-up qui
est censé ouvrir une image en redimensionnant la taille de la fenêtre à
la taille de l'image.
Sous Firefox aucun souci ça fait bien ce que je veux mais sou Ie
grrrrrrrr alors j'ai soit page blanche, soit affichage de la moitié de
la photo, soit affichage complet de la photo mais sans dimensionnement
??? comprend pas pourquoi ?? pour avoir ce que je veux je suis obligé de
rafraîchir la pop-up à la main ???
Merci par avance pour votre aide.


Page qui bug grrrrrrrrrrrr
###################################################################""
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="imagetoolbar" content="no">
<!--<noscript><meta http-equiv="refresh"
content="0;URL=desoler.php"></noscript>-->
<script type="text/javascript" language="javascript">
function checksize()
{
if (document.images[0].complete)
{
var heigth = document.images[0].width+12;
var wiegth = document.images[0].height+30;
window.resizeTo(heigth,wiegth);
window.focus();
}
else
{
setTimeout('checksize()',1)
}
}
</script>
<title>Le gr&egrave;s de c&eacute;rame</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<meta http-equiv="pragma" content="no-cache">
</head>
<body onLoad="checksize()" oncontextmenu="return false"
ondragstart="return false" onselectstart="return false" scroll="no"
leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" >
<img src="../img/pres/rom.jpg">
</body>
</html>
########################################################################

3 réponses

Avatar

sous IE
grrrrrrrr alors j'ai soit page blanche, soit affichage de la moitié de
la photo, soit affichage complet de la photo mais sans dimensionnement
??? comprend pas pourquoi ?? pour avoir ce que je veux je suis obligé de
rafraîchir la pop-up à la main ???


Pourtant ! pour un truc construit exprès pour IE ! Hein ? curious no ?

Ben !
avec un timer d'une miliseconde qui relance la fonction de chargement
tu ne laisses pas beaucoup de temps à l'ordi pour réaliser ce chargement !

cf + bas dans ton code

sinon je te propose çà qui fonctionne impec (même avec NC4):
(sauf avec mon Opera qui est une vraie m...e)

<html>
<head><title>test pop photo</title>
<script type="text/javascript">
trucúlse;
text= '';
I = '';
function pop(photo,titre) {
if(document.getElementById)
document.getElementById('wait').style.display='block';
text = '<html>'+'<'+'title>'+titre+'<'+'/title>'+
'<body background="'+photo+'" onclick="self.close();">'+
'<'+'/body>'+'<'+'/html>';
if(document.all)
I=document.images[0];
else
I = new Image();
I.onload = ouvrepop;
I.src = photo;
}
function ouvrepop() {
truc = window.open('','','left='+(screen.width-I.width)/2+
',top='+(screen.height-I.height-20)/2+
',width='+I.width+
',height='+I.height+',resizable=0');
with(truc.document){open();write(text);close();}
if(document.images[0])
document.images[0].src='';
if(document.getElementById)
document.getElementById('wait').style.display='none';
}
</script></head>
<body>
<img style="display:none;" src="">
<h2 id="wait" style="display:none">Patience ...</h2>
<p><a href="st_trop/gd_m_1.jpg" target="_blank"
onclick="pop(this.href,'Grand Mere a St Trop'); return false;">
St Trop' 1</a>
</body></html>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="imagetoolbar" content="no">
<!--<noscript><meta http-equiv="refresh"
content="0;URLÞsoler.php"></noscript>-->
<script type="text/javascript" language="javascript">
function checksize()
{
if (document.images[0].complete)
{
var heigth = document.images[0].width+12;
var wiegth = document.images[0].height+30;
window.resizeTo(heigth,wiegth);
window.focus();
}
else
{
setTimeout('checksize()',1)


mettre au moins :

setTimeout('checksize()',200);

et peut-être préférer :

if (!(document.images[0].complete))
setTimeout('checksize()',200);
else
{
var heigth = document.images[0].width+12;
var wiegth = document.images[0].height+30;
window.resizeTo(heigth,wiegth);
window.focus();
}

ou (pas essayé) :

else
{
var heigth = document.images[0].width;
var wiegth = document.images[0].height;
if(document.getElementById) {
var B = document.getElementsByTagName('body');
B[0].style.backgroundImage='url('+
document.images[0].src+')';
document.images[0].style.display='none';
}
else {
heigth += 12;
wiegth += 20;
}
window.resizeTo(heigth,wiegth);
window.focus();
}


}
</script>
<title>Le gr&egrave;s de c&eacute;rame</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<meta http-equiv="pragma" content="no-cache">
</head>
<body onLoad="checksize()" oncontextmenu="return false"
ondragstart="return false" onselectstart="return false" scroll="no"
leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" >
<img src="../img/pres/rom.jpg">
</body>
</html>




--
******** (enlever/remove [OTER_MOI] du/from reply url) *******
Stéphane MORIAUX : mailto:
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
**************************************************************

Avatar
luc
Merci beaucoup ; ) et désolé pour le multi postage : (j'ai trouvé la
solution qui marche ; ) Dans le href, je met "#" dans le onclick ma
fonction window.open et à la fin un return false salvateur qui permet
que ça passe sous NS ; ) . merci des solutions Je vais tester tous ça ;
) Mais ta solution d'écrire du html avec le javascript j’avouerais que
par les temps de paranoïa générale j'utilise de moins en moins
javascript et surtout pour écrire du html en tous cas merci

ps lol opera m'en parle pas : ((( (souvenir gros souci seulement sous
Opera avec encodage url )

sous IE
grrrrrrrr alors j'ai soit page blanche, soit affichage de la moitié de
la photo, soit affichage complet de la photo mais sans dimensionnement
??? comprend pas pourquoi ?? pour avoir ce que je veux je suis obligé de
rafraîchir la pop-up à la main ???



Pourtant ! pour un truc construit exprès pour IE ! Hein ? curious no ?

Ben !
avec un timer d'une miliseconde qui relance la fonction de chargement
tu ne laisses pas beaucoup de temps à l'ordi pour réaliser ce chargement !

cf + bas dans ton code

sinon je te propose çà qui fonctionne impec (même avec NC4):
(sauf avec mon Opera qui est une vraie m...e)

<html>
<head><title>test pop photo</title>
<script type="text/javascript">
trucúlse;
text= '';
I = '';
function pop(photo,titre) {
if(document.getElementById)
document.getElementById('wait').style.display='block';
text = '<html>'+'<'+'title>'+titre+'<'+'/title>'+
'<body background="'+photo+'" onclick="self.close();">'+
'<'+'/body>'+'<'+'/html>';
if(document.all)
I=document.images[0];
else
I = new Image();
I.onload = ouvrepop;
I.src = photo;
}
function ouvrepop() {
truc = window.open('','','left='+(screen.width-I.width)/2+
',top='+(screen.height-I.height-20)/2+
',width='+I.width+
',height='+I.height+',resizable=0');
with(truc.document){open();write(text);close();}
if(document.images[0])
document.images[0].src='';
if(document.getElementById)
document.getElementById('wait').style.display='none';
}
</script></head>
<body>
<img style="display:none;" src="">
<h2 id="wait" style="display:none">Patience ...</h2>
<p><a href="st_trop/gd_m_1.jpg" target="_blank"
onclick="pop(this.href,'Grand Mere a St Trop'); return false;">
St Trop' 1</a>
</body></html>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="imagetoolbar" content="no">
<!--<noscript><meta http-equiv="refresh"
content="0;URLÞsoler.php"></noscript>-->
<script type="text/javascript" language="javascript">
function checksize()
{
if (document.images[0].complete)
{
var heigth = document.images[0].width+12;
var wiegth = document.images[0].height+30;
window.resizeTo(heigth,wiegth);
window.focus();
}
else
{
setTimeout('checksize()',1)



mettre au moins :

setTimeout('checksize()',200);

et peut-être préférer :

if (!(document.images[0].complete))
setTimeout('checksize()',200);
else
{
var heigth = document.images[0].width+12;
var wiegth = document.images[0].height+30;
window.resizeTo(heigth,wiegth);
window.focus();
}

ou (pas essayé) :

else
{
var heigth = document.images[0].width;
var wiegth = document.images[0].height;
if(document.getElementById) {
var B = document.getElementsByTagName('body');
B[0].style.backgroundImage='url('+
document.images[0].src+')';
document.images[0].style.display='none';
}
else {
heigth += 12;
wiegth += 20;
}
window.resizeTo(heigth,wiegth);
window.focus();
}



}
</script>
<title>Le gr&egrave;s de c&eacute;rame</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<meta http-equiv="pragma" content="no-cache">
</head>
<body onLoad="checksize()" oncontextmenu="return false"
ondragstart="return false" onselectstart="return false" scroll="no"
leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" >
<img src="../img/pres/rom.jpg">
</body>
</html>








Avatar

Dans le href, je met "#" dans le onclick ma
fonction window.open et à la fin un return false salvateur qui permet
que ça passe sous NS ; ) .


Exactement ce que je donne comme soluce ;-))

merci des solutions Je vais tester tous ça ;


Oui, paske le timer à une miliseconde, ça me parait court court.

) Mais ta solution d'écrire du html avec le javascript j’avouerais que
par les temps de paranoïa générale j'utilise de moins en moins
javascript et surtout pour écrire du html en tous cas merci


N'importe quoi !
qu'est-ce que tu me bargouines ?
et comment tu montres ta photo alors ? ?
avec href="#" ==> rien
avec href="photo.htm" ==> peut-être
mais, dans les 2 cas, pas de pop-up et pas
de redimesionnement non plus si pas de JS
... alors ? pourquoi paranoïaquer sur de l'écriture par JS ?

Note qu'avec ma soluce, même avec JS désactivé la photo est montrée ! ! !

Sinon, analyse la méhode donnée de redimensionnement
elle peut être adaptée à ta méthode
(donc sans écriture en JS)
(mais avec JS pour le redimensionnement)


Pourtant ! pour un truc construit exprès pour IE ! Hein ? curious no ?

Ben !
avec un timer d'une miliseconde qui relance la fonction de chargement
tu ne laisses pas beaucoup de temps à l'ordi pour réaliser ce chargement !

cf + bas dans ton code

sinon je te propose çà qui fonctionne impec (même avec NC4):
(sauf avec mon Opera qui est une vraie m...e)

<html>
<head><title>test pop photo</title>
<script type="text/javascript">
trucúlse;
text= '';
I = '';
function pop(photo,titre) {
if(document.getElementById)
document.getElementById('wait').style.display='block';
text = '<html>'+'<'+'title>'+titre+'<'+'/title>'+
'<body background="'+photo+'" onclick="self.close();">'+
'<'+'/body>'+'<'+'/html>';
if(document.all)
I=document.images[0];
else
I = new Image();
I.onload = ouvrepop;
I.src = photo;
}
function ouvrepop() {
truc = window.open('','','left='+(screen.width-I.width)/2+
',top='+(screen.height-I.height-20)/2+
',width='+I.width+
',height='+I.height+',resizable=0');
with(truc.document){open();write(text);close();}
if(document.images[0])
document.images[0].src='';
if(document.getElementById)
document.getElementById('wait').style.display='none';
}
</script></head>
<body>
<img style="display:none;" src="">
<h2 id="wait" style="display:none">Patience ...</h2>
<p><a href="st_trop/gd_m_1.jpg" target="_blank"
onclick="pop(this.href,'Grand Mere a St Trop'); return false;">
St Trop' 1</a>
</body></html>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="imagetoolbar" content="no">
<!--<noscript><meta http-equiv="refresh"
content="0;URLÞsoler.php"></noscript>-->
<script type="text/javascript" language="javascript">
function checksize()
{
if (document.images[0].complete)
{
var heigth = document.images[0].width+12;
var wiegth = document.images[0].height+30;
window.resizeTo(heigth,wiegth);
window.focus();
}
else
{
setTimeout('checksize()',1)



mettre au moins :

setTimeout('checksize()',200);

et peut-être préférer :

if (!(document.images[0].complete))
setTimeout('checksize()',200);
else
{
var heigth = document.images[0].width+12;
var wiegth = document.images[0].height+30;
window.resizeTo(heigth,wiegth);
window.focus();
}

ou (pas essayé) :

else
{
var heigth = document.images[0].width;
var wiegth = document.images[0].height;
if(document.getElementById) {
var B = document.getElementsByTagName('body');
B[0].style.backgroundImage='url('+
document.images[0].src+')';
document.images[0].style.display='none';
}
else {
heigth += 12;
wiegth += 20;
}
window.resizeTo(heigth,wiegth);
window.focus();
}



}
</script>




--
******** (enlever/remove [OTER_MOI] du/from reply url) *******
Stéphane MORIAUX : mailto:
Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)
http://perso.wanadoo.fr/stephane.moriaux/internet/
**************************************************************