Hauteur Automatique sur un Object ( pas Iframe ) pour WC3

Résolu
Fireflect Messages postés 51 Date d'inscription mercredi 16 juin 2004 Statut Membre Dernière intervention 14 septembre 2005 - 3 sept. 2005 à 13:25
Fireflect Messages postés 51 Date d'inscription mercredi 16 juin 2004 Statut Membre Dernière intervention 14 septembre 2005 - 7 sept. 2005 à 17:03
Bonjours tt le monde voila j'essaye de faire une page avec un objet
utilisé comme une Iframe..j'aimerai que l'Iframe et que la page
s'ajuste en fonction de la grandeur du contenu de l'Iframe...voici le
code:



<hr size="2" width="100%"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">

<head>

<script type="text/javascript">

function ObjectHeight()

{

var h = 0;

if(document.all) // Internet.Explorer

{

h = document.frames['myIframe'].document.body.scrollHeight;

document.all.myIframe.style.height = h+15;

}

else // fireox.0.9.2 + ; netscape.7.0 +

{

h = document.getElementById('myIframe').contentDocument.body.offsetHeight;

document.getElementById('myIframe').style.height = h+15;

}

}

</script>

<title>OtherWorlD RPG</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style type="text/css">

<!--

body {

margin: 0;

padding: 0;

height: 1000em;

}

#contenu{



width:20em;

height:100%;

position:absolute;

left:0;

top:0;



background-color: yellow;

}

-->

</style>

</head>





<object type="text/html" data="pages/accueil2.html" width="640px" height="100%"></object>







</html>

<hr size="2" width="100%">Le code en Javascript au dessus est juste
l'autoHeight d'avant car j'avais fait ca avec une Iframe mais ca disait
que c'était pas compatible W3C



La hauteur dans le Body est Obligatoir pour que ca soye compatible IE

Donc voila si vous savez m'aider en me plaquant un code qui s'applique
sur l'objet ou en modifiant la fonction Javascript pour remplacer
Iframe par Object..



Merci Bien de votre compréension Bonne soirée

3 réponses

coucou747 Messages postés 12303 Date d'inscription mardi 10 février 2004 Statut Membre Dernière intervention 30 juillet 2012 44
4 sept. 2005 à 10:36
ajoutes en CSS



overflow:auto;

In a dream, I saw me, drop dead... U was here, U cried... It was just a deam, if I die, U won't cry, maybe, U'll be happy

http://coucou747.hopto.org
3
Fireflect Messages postés 51 Date d'inscription mercredi 16 juin 2004 Statut Membre Dernière intervention 14 septembre 2005
3 sept. 2005 à 16:22
C'est moi le code va mais j'ai deu supprimer la ligne de vérification W3C

Et j'ai du mal a trouver une alternative pour Redimentionner avec W3C actif..j'aimerai avoir cette **** de signature!



<hr size="2" width="100%"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<strike>"http://www.w3.org/TR/html4/loose.dtd"></strike>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">

<head>

<script language="Javascript" type="text/javascript" >

function iFrameHeight()

{

var h = 0;

if(document.all) // Internet.Explorer

{

h = document.frames['myIframe'].document.body.scrollHeight;

document.all.myIframe.style.height = h+15;

}

else // fireox.0.9.2 + ; netscape.7.0 +

{

h = document.getElementById('myIframe').contentDocument.body.offsetHeight;

document.getElementById('myIframe').style.height = h+15;

}

}

</script>



<title>Sans Titre</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<style type="text/css">

<!--

body {

margin: 0;

padding: 0;



}

#if1{



left:0;

top:0;

overflow:hidden;



}

-->

</style>

</head>





<object id="myIframe" name="if1" data="pages/accueil2.html"
width="800" marginheight="0" allowtransparency="true"
>Iframe</object>





</html>

<hr size="2" width="100%">

Si quelqu'un aurai une sollution ce serai simpa
0
Fireflect Messages postés 51 Date d'inscription mercredi 16 juin 2004 Statut Membre Dernière intervention 14 septembre 2005
7 sept. 2005 à 17:03
Ui je sais pas j'ai mis un raffraichissement automatique et il va puit
je viens de l'enlever et ca marche toujours :/ il bug plus par rapport
a ca et je suis incappable de dire pourquoi :(



enfin maintenant le défi c de tout transformer en W3C si vous savez M'aider ;) c pas de refus



<hr size="2" width="100%"><html>

<head>

<script language="Javascript" type="text/javascript" >

function iFrameHeight()

{

var h = 0;

if(document.all) // Internet.Explorer

{

h = document.frames['myIframe'].document.body.scrollHeight;

document.all.myIframe.style.height = h+15;

}

else // fireox.0.9.2 + ; netscape.7.0 +

{

h = document.getElementById('myIframe').contentDocument.body.offsetHeight;

document.getElementById('myIframe').style.height = h+15;

}

}

</script>



<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">

<!--

body {

margin:0px;

background-image:url('Images/fond.jpg');

background-attachment:inherit;

background-position:left;

margin-top: 0px;

background-repeat:repeat;

background-color:#FFFFFF;

margin-left: 0px;

margin-bottom: 0px;

background-position:top;

scrollbar-face-color: #FAF4E4;

scrollbar-shadow-color: #000000;

scrollbar-highlight-color: #000000;

scrollbar-3dlight-color: #000000;

scrollbar-darkshadow-color: #000000;

scrollbar-track-color: #000000;

scrollbar-arrow-color: #000000;

height:101%;

}

#ifr{

width:600px;

height:500px;

}

#menu{

width: 168px;

height:25px;

background-color:#000000;

float:left;

}

.Style5 {font-size: 10px}

-->

</style>





<object
type="application/x-shockwave-flash" data="menu.swf" width="168"
height="418">

You
need flash player plugin:
http://www.macromedia.com/go/getflashplayer

</object>,

<td width=\"100%\" height=\"100%\" align=\"center\" valign=\"top\" \"style=\"vertical-align:top;\">

&nbsp;

Iframe








</html>

<hr size="2" width="100%">Voila le code de A à Z

L'iframe est incompatible W3C :s avec Src c space de mettre une iframe sans Src



et quand je le change en Object ...Data.. ben flash délire dessus enfin
arrive plus a le gérer ^^ enfin j'vais voir ca tit a petit la..thx...ca ce peu qu'il aye du code inutile a certain endroit j'vais cleaner ca..toute aide est le bienvenu pour le W3C



Bonne journée
0
Rejoignez-nous