Iframe avec hauteur variable - Programmation
TomsGuide.com : 700 000 inscrits répondent à toutes vos questions high-tech et informatique.
Pour obtenir de l'aide, inscrivez-vous gratuitement !
 

Ajouter une réponse



 Mot :   Pseudo :  
 
Bas de page
Auteur
 Sujet : Iframe avec hauteur variable
 
Profil : IDNaute
Plus d'informations

Bonjour a tous

je suis entrain de faire un site dont le corpt du site et une frame
mais comment fair pour que la frame frame prene la place quel veux en hauteur

comme si j'avais mis height="auto" qui ne marche pas

j'ai vue quil falais enlevais la doctrine ensuite 100% marchais
mais sa ne marche pas

???????????????


voila lecode si sa peut vou aider

<html>
<head>
<title>Bienvenue al-ka-y-dien</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">td img {display: block;}</style>
<!--Fireworks 8 Dreamweaver 8 target. Created Fri Apr 20 19:18:44 GMT+0200 2007-->
<script src="../../Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<SCRIPT LANGUAGE="JavaScript">
function clicie() {
// Fonction de détection pour Internet Explorer
if ((event.button==2)||(event.button==3)) {
alert("Respectez les droits d'auteur..." );
}
}
function clicns(e){
// Fonction pour Netscape
if(e.which==3){
alert("Respectez les droits d'auteur..." );
return false;
}
}


if (document.all) { document.onmousedown=clicie;}
if (document.layers) {document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clicns;}
if (window.sidebar) {document.captureEvents(Event.MOUSEDOWN); document.onmousedown = clicns;}

</SCRIPT>
</head>
<body bgcolor="#ffff67">
<table border="0" cellpadding="0" cellspacing="0" width="750" align="center">
<!-- fwtable fwsrc="index.png" fwbase="index.jpg" fwstyle="Dreamweaver" fwdocid = "905486688" fwnested="0" -->
<tr>
<td><img src="images/spacer.gif" width="40" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="16" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="630" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="12" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="20" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="32" height="1" border="0" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="1" border="0" alt="" /></td>
</tr>

<tr>
<td colspan="6"><img name="index_r1_c1" src="images/index_r1_c1.jpg" width="750" height="44" border="0" id="index_r1_c1" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="44" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="2" colspan="2"><img name="index_r2_c1" src="images/index_r2_c1.jpg" width="56" height="99" border="0" id="index_r2_c1" alt="" /></td>
<td colspan="2"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0','width','642','height','75','src','swf/ban','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','swf/ban' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="642" height="75">
<param name="movie" value="swf/ban.swf" />
<param name="quality" value="high" />
<embed src="swf/ban.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="642" height="75"></embed>
</object></noscript></td>
<td rowspan="2" colspan="2"><img name="index_r2_c5" src="images/index_r2_c5.jpg" width="52" height="99" border="0" id="index_r2_c5" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="75" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="2"><img name="index_r3_c3" src="images/index_r3_c3.jpg" width="642" height="24" border="0" id="index_r3_c3" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="24" border="0" alt="" /></td>
</tr>
<tr>
<td><img name="index_r4_c1" src="images/index_r4_c1.jpg" width="40" height="146" border="0" id="index_r4_c1" alt="" /></td>
<td colspan="4"><iframe name="menu"
align="center"
marginwidth="0"
marginheight="0"
src="menu1.html"
frameborder="no"
scrolling="auto"
width="678"
height="146">
</iframe></td>
<td><img name="index_r4_c6" src="images/index_r4_c6.jpg" width="32" height="146" border="0" id="index_r4_c6" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="146" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="6"><img name="index_r5_c1" src="images/index_r5_c1.jpg" width="750" height="16" border="0" id="index_r5_c1" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="16" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="6">

<iframe name="corpt"
align="center"
marginwidth="0"
marginheight="0"
src="index_admin.php"
frameborder="no"
scrolling="no"
width="750"
height="100%">
</iframe>

</td>
<td><img src="images/spacer.gif" width="1" height="85" border="0" alt="" /></td>
</tr>
<tr>
<td colspan="6"><img name="index_r7_c1" src="images/index_r7_c1.jpg" width="750" height="22" border="0" id="index_r7_c1" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="22" border="0" alt="" /></td>
</tr>
<tr>
<td rowspan="3" colspan="2"><img name="index_r8_c1" src="images/index_r8_c1.jpg" width="56" height="88" border="0" id="index_r8_c1" alt="" /></td>
<td>
<iframe name="copyright"
align="center"
marginwidth="0"
marginheight="0"
src="autreframe/copyright.html"
frameborder="no"
scrolling="no"
width="630"
height="30">
</iframe>
</td>
<td rowspan="3" colspan="3"><img name="index_r8_c4" src="images/index_r8_c4.jpg" width="64" height="88" border="0" id="index_r8_c4" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="30" border="0" alt="" /></td>
</tr>
<tr>
<td> <iframe name="heure javascript"
align="center"
marginwidth="0"
marginheight="0"
src="autreframe/heure.html"
frameborder="no"
scrolling="no"
width="630"
height="37">
</iframe></td>
<td><img src="images/spacer.gif" width="1" height="37" border="0" alt="" /></td>
</tr>
<tr>
<td><img name="index_r10_c3" src="images/index_r10_c3.jpg" width="630" height="21" border="0" id="index_r10_c3" alt="" /></td>
<td><img src="images/spacer.gif" width="1" height="21" border="0" alt="" /></td>
</tr>
</table>
</body>
</html>



c'est ma la iframe en rouge qui pose probleme


Message édité par andrelec1 le 22-04-2007 à 11:09:17
Liens spon sorisés

Inscrivez-vous ou connectez-vous pour masquer ceci.

Profil : IDNaute
Plus d'informations

Up

snif

Profil : IDNaute
Plus d'informations

UP svp

Profil : IDNaute
Plus d'informations

Up je suis deseperer !

Profil : IDNaute
Plus d'informations

J'ais la solution ^^, que j'ais trouver en cherchant pas mal sur divers forums, par contre il faut que tu sache que si tu applique ma solution (qui me parait etre la seul), le contenu de ta frame sera uniquement visible aux internautes ayant les dernieres versions de leur navigateur, IE7, Mozilla FF ect...

Regarde mon site http://area-fiftyone.ifrance.com (clic sur les liens des membres en bas) pour avoir un aperçus.

Je te donne le code que tu adapteras a ta page:

A placer dans la la balise head, AVANT! ta feuille de style css:
-------------------------------------------------

Code :
  1. <head>
  2. <script>
  3. function actu_iframe(){
  4. if(navigator.appName=="Microsoft Internet Explorer" ){
  5. if(document.all) document.all.id_iframe.style.height = document.frames("ID DE TON IFRAME" ).document.body.scrollHeight;
  6. else document.getElementById("ID DE TON IFRAME" ).style.height = document.getElementById("ID DE TON IFRAME" ).contentDocument.body.scrollHeight;
  7. }
  8. else{
  9. document.getElementById("iframe" ).style.height = document.getElementById("iframe" ).contentDocument.body.offsetHeight+"px";
  10. }
  11. }
  12. </script>     
  13. <!--[if gte IE 5]>
  14.                 <script>
  15.                 function actu_iframe()
  16. {
  17. if(document.all) document.all.iframe.style.height = document.frames("ID DE TON IFRAME" ).document.body.scrollHeight;
  18. else document.getElementById("ID DE TON IFRAME" ).style.height = document.getElementById("ID DE TON IFRAME" ).contentDocument.body.scrollHeight;
  19. }
  20. </script>
  21.         <![endif]-->
  22. <link rel="stylesheet" media="screen" type="text/css" title="xxx" href="TA FEUILLE DE STYLE.css"/>
  23. </head>


------------------------------------------------------------

A placer dans ta balise iframe:
------------------------------------------------------------

Code :
  1. <iframe onLoad="actu_iframe();" id="ID DE TON IFRAME"></iframe>



J'espère que ca t'auras aidé!


Message édité par stickmania k le 18-07-2007 à 13:50:49
Profil : Extensionaute
Plus d'informations

Tiens, j'aurais jamais pensé que ça puisse être possible. :)

Merci pour ce bout de code, même si tu lui réponds 3 mois après ;)


---------------
/!\ Venez affronter la mort ! /!\
Profil : IDNaute
Plus d'informations

Oui, élasse, c'est maintenant que j'ais mis a jour mon site que j'ais repensé a tous ça...j'ais aussi pensé qu'il fallait faire profiter!

Profil : IDNaute
Plus d'informations

Merci
même si je n'en plus besoin sa peut toujours servir ( quoi que , je peut m'en servir ! XD )

Mais bon 3 mois âpres , j'attendais pas trop de réponse ,
je vais pourvoir mettre en résolut XD


---------------
XD --> peut aussi se dessiner --> XP
Microsoft se fout-il pas ne notre tete avec son XP ???
Profil : IDNaute
Plus d'informations

peut -tu changer les balise de ton post
et mettre des balise fixed au lieu de code stp !


---------------
XD --> peut aussi se dessiner --> XP
Microsoft se fout-il pas ne notre tete avec son XP ???
Profil : IDNaute
Plus d'informations

voila le code de ma page :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--"http://www.w3.org/TR/html4/loose.dtd"-->
<html>
<head>
<title>ALKAHIDA</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
function actu_iframe(){
if(navigator.appName=="Microsoft Internet Explorer" ){
if(document.all) document.all.id_iframe.style.height = document.frames("page" ).document.body.scrollHeight;
else document.getElementById("page" ).style.height = document.getElementById("page" ).contentDocument.body.scrollHeight;
}
else{
document.getElementById("iframe" ).style.height = document.getElementById("iframe" ).contentDocument.body.offsetHeight+"px";
}
}
</script>
<!--[if gte IE 5]>
<script>
function actu_iframe()
{
if(document.all) document.all.iframe.style.height = document.frames("page" ).document.body.scrollHeight;
else document.getElementById("page" ).style.height = document.getElementById("page" ).contentDocument.body.scrollHeight;
}
</script>
<![endif]-->
<link href="image/lien.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #333333;
scrollbar-3dlight-color: #00000;
scrollbar-arrow-color: #000000;
scrollbar-base-color: #666666;
scrollbar-darkshadow-color: Black;
scrollbar-face-color: #FFCC66;
scrollbar-highlight-color: #666666;
scrollbar-shadow-color: #666666;
scrollbar-track-color: #333333;
}
.Style1 {font-weight: bold}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#" )!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>

<body onLoad="MM_preloadImages('image/bouton2.png')">
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="800" height="160" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="20" rowspan="3" valign="top" background="image/image1.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="490" height="40" valign="top" background="image/image2.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="280" rowspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="280" height="130" align="right" valign="middle" background="image/image4.png"><img src="image/logo.png" width="243" height="91"></td>
</tr>
</table></td>
<td width="10" rowspan="3" valign="top" background="image/image5.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
</tr>
<tr>
<td height="90" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="490" height="90" align="left" valign="middle" background="image/image3.png"><img src="image/ban1.png" width="468" height="60"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="auto" height="30" align="left" valign="middle"><a href="#" class="menu">Accueil . </a></td>
<td width="auto" align="left" valign="middle"><a href="page/" target="page" class="menu">Photos . </a></td>
<td width="auto" align="left" valign="middle"><a href="#" class="menu">Vidéos . </a></td>
<td width="auto" align="left" valign="middle"><a href="#" class="menu">Bouteilles ? </a></td>
<td width="auto" align="left" valign="middle"><a href="#" class="menu">Plant ?</a></td>
<td width="auto" align="left" valign="middle"><a href="#" class="menu">Nous !</a></td>
<td width="auto" align="left" valign="middle"><a href="#" class="menu">Vous ! </a></td>
<td width="auto" align="left" valign="middle"><a href="admin/index.php" target="page" class="menu">Admin.</a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="0"></td>
<td></td>
<td></td>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td height="745" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="800" height="13"></td>
</tr>
<tr>
<td height="423" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="50" height="30" valign="top" background="image/tv1.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="700" valign="top" background="image/tv2.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="50" valign="top" background="image/tv3.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
</tr>
<tr>
<td height="210" valign="top" background="image/tv4.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td rowspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="700" height="353"><iframe onLoad="actu_iframe();" src="page/accueil.php" id="page" name="page" width="700" align="right" scrolling="auto" frameborder="0"></iframe></td>
</tr>
</table></td>
<td valign="top" background="image/tv4.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<tr>
<td height="70" valign="top" background="image/tv6.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td valign="top" background="image/tv6.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<tr>
<td height="73" valign="top" background="image/tv4.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td valign="top" background="image/tv4.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<tr>
<td height="40" valign="top" background="image/tv8.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td valign="top" background="image/tv9.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td valign="top" background="image/tv10.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
</tr>
<tr>
<td height="0"></td>
<td></td>
<td></td>
</tr>
</table></td>
</tr>
<tr>
<td height="22">&nbsp;</td>
</tr>
<tr>
<td height="268" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="49" height="30" valign="top" background="image/cadre1.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="462" valign="top" background="image/cadre2.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="29" valign="top" background="image/cadre3.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="260">&nbsp;</td>
</tr>
<tr>
<td height="89" valign="top" background="image/cadre4.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td colspan="3" rowspan="3" valign="top" class="cadre"><div align="center">
<p><strong>D</strong>esigne by<strong> T</strong>eddy.<br>
<strong>S</strong>ite by <strong>T</strong>eddy,<strong> B</strong>enjamin,<strong> A</strong>ntoine.<br>
<strong>S</strong>ite mientenue par :<strong> A</strong>ntoine, <strong>B</strong>enjamin, <strong>C</strong>olin, <strong>J</strong>ordann,<strong> R</strong>odolphe, <strong>Y</strong>ohann,<strong> T</strong>eddy . </p>
</div><br> <br> <br><div align="center" ><p><strong>Copyright : <br>
&quot;Tout pourri Corporarion &copy;
2007&quot;, tout droits réservés.</strong></p></div>
</td>
</tr>
<tr>
<td height="90" valign="top" background="image/cadre5.png"><!--DWLayoutEmptyCell-->&nbsp;</td>
</tr>
<tr>
<td height="59"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="19" align="center" valign="middle" class="Style1"></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>



sa ne marche pas !!!
mais pourquoi ?


---------------
XD --> peut aussi se dessiner --> XP
Microsoft se fout-il pas ne notre tete avec son XP ???
Profil : Extensionaute
Plus d'informations

Quand il a dit "ID FRAME", ça veut dire qu'il faut remplacer cette valeur là par l'ID de ta frame.
Dans ton cas, tu as nommé ta phrase "page", donc il ne faut pas appeler la frame avec "id_frame", mais avec "page"


---------------
/!\ Venez affronter la mort ! /!\
Profil : IDNaute
Plus d'informations

OUI
est j'ai bien remplacer toutes les valeur !!

 

je vais mettre ma page en html au lieu de htm ! et je vous dit !

 


Edit = " Ba non toujours pas , même en html " !


Message édité par andrelec1 le 19-07-2007 à 19:50:02

---------------
XD --> peut aussi se dessiner --> XP
Microsoft se fout-il pas ne notre tete avec son XP ???
Profil : Extensionaute
Plus d'informations

Me dis pas que tu as bien toutes les valeurs; dans le code que tu nous as donné, ça correspond à rien tout ce que tu as mis.
Tu nommes ton iframe "page", après tu l'utilises avec "id_frame" et "iframe"


---------------
/!\ Venez affronter la mort ! /!\
Profil : IDNaute
Plus d'informations

Omar ta réponse me fait rigoulé!, Adrelec1, je me suis un peu perdu dans
ton tableau, entre les tr, td, th ect...ca serais mieu si tu mettais ta page en ligne qu'on puisse voir a quoi cela ressemble, ou même un screenshot de ta page... sinon, je vois que tu appel une feuille de style .css, et qu'en dessous tu rajo