Iframe ?
3 messages
• Page 1 sur 1
- ArnoC
- Nouveau WRInaute

- Messages: 2
- Inscription: 22 Mai 2007
Iframe ?
Bonjour,
Je suis en train de réaliser un site et j'aimerai si possible éviter
l'utilisation d'IFRAME.
La seule réelle utilité que j'ai à me servir d'une iframe, c'est simplement
par rapport à l'animation Flash qui permet la navigation générale. Sans
IFRAME, l'animation se recharge à chaque nouvelle ouverture de page, ce qui
fait un effet de clignotement qui n'est pas terrible d'un point de vue
esthétique.
Pour le moment, j'ai simplement trouvé, la solution de l'IFRAME
En me rendant sur ce site http://www.katiemelua.com/index2.html et en
enregistrant la source, je me suis rendu compte qu'il utilisait également
des iframes, mais que celle ci ne créait pas d'ascenseur et était extensible
automatiquement. J'ai essayé de reproduite le même code, sans obtenir le
résultat voulu.
Est-ce que quelqu'un connait-il une petite astuce pour y arriver à quelque
chose de semblable ?
Voici globalement les zones de mon site
Je souhaite donc rendre la zone de texte extensible en fonction de la
longueur des pages sans avoir l'apparition d'ascenseur et s'en avoir mon
animation Flash qui s'exécute et clignote à chaque ouverture de page
Merci beaucoup
Je suis en train de réaliser un site et j'aimerai si possible éviter
l'utilisation d'IFRAME.
La seule réelle utilité que j'ai à me servir d'une iframe, c'est simplement
par rapport à l'animation Flash qui permet la navigation générale. Sans
IFRAME, l'animation se recharge à chaque nouvelle ouverture de page, ce qui
fait un effet de clignotement qui n'est pas terrible d'un point de vue
esthétique.
Pour le moment, j'ai simplement trouvé, la solution de l'IFRAME
En me rendant sur ce site http://www.katiemelua.com/index2.html et en
enregistrant la source, je me suis rendu compte qu'il utilisait également
des iframes, mais que celle ci ne créait pas d'ascenseur et était extensible
automatiquement. J'ai essayé de reproduite le même code, sans obtenir le
résultat voulu.
Est-ce que quelqu'un connait-il une petite astuce pour y arriver à quelque
chose de semblable ?
Voici globalement les zones de mon site
Je souhaite donc rendre la zone de texte extensible en fonction de la
longueur des pages sans avoir l'apparition d'ascenseur et s'en avoir mon
animation Flash qui s'exécute et clignote à chaque ouverture de page
Merci beaucoup
-

Joe Le Mort - WRInaute occasionnel

- Messages: 260
- Inscription: 8 Aoû 2006
pourquoi pa en PHP avec un include ?
dans ta page :
nan ?
dans ta page :
- Code: Tout sélectionner
<?php
include "/tonfichieravec tonflash.html";?>
nan ?
- ArnoC
- Nouveau WRInaute

- Messages: 2
- Inscription: 22 Mai 2007
Bonjour,
Merci pour ta réponse, mais l'include ne résout pas le problème
J'ai résolu en grande partie mon problème, en intégrant une iframe qui s'ajuste en fonction du contenu voici le résultat sur ce site www.ekotec.fr.
Cependant, il reste un hic qui se produit régulièrement sous IE (très rarement, il n'y a pas vraiment ce problème, c'est étrange). En fait, lorsque l'on clique sur un lien, la zone comporant le contenu s'agrandit, elle s'aggrandit de clic en clic
Je n'ai pas du tout de problème sous Firefox, que faire pour y remédier svp ? Voici mon code
Merci pour votre aide
DANS LA PAGE CONTENANT L'IFRAME
<script type="text/javascript">
function adjustIFrameSize (iframeWindow) {
if (iframeWindow.document.height) {
var iframeElement = document.getElementById
(iframeWindow.name);
iframeElement.style.height = iframeWindow.document.height + 'px';
iframeElement.style.width = iframeWindow.document.width + 'px';
}
else if (document.all) {
var iframeElement = document.all[iframeWindow.name];
if (iframeWindow.document.compatMode &&
iframeWindow.document.compatMode != 'BackCompat')
{
iframeElement.style.height =
iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
iframeElement.style.width =
iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
}
else {
iframeElement.style.height =
iframeWindow.document.body.scrollHeight + 5 + 'px';
iframeElement.style.width =
iframeWindow.document.body.scrollWidth + 5 + 'px';
}
}
}
</script>
<iframe id="contenu" name="contenu" src="accueil.html" marginwidth="0" marginheight="0" align="middle" scrolling="Auto" frameborder="0" width="715"> <br />
Sorry your browser does not support Iframes. ekotec.fr makes extensive use of iFrames througout the site. In order to view it properly please update your browser.<br />
We recommend <a href="http://www.microsoft.com/downloads/searchdl.asp?" target="_blank">IE 5+</a> for both Mac and PC. Thanks!</font></iframe>
DANS LES PAGES DEVANT ETRE AFFICHES DANS LES IFRAMES
</SCRIPT>
</head>
<body onload="if (parent.adjustIFrameSize)
parent.adjustIFrameSize(window);MM_preloadImages('images/vignette-devis-2.gif')"
>
<script type="text/javascript">
POUR EMPECHER LE REFERENCE A INSERER DANS LES PAGES DEVANT ETRE AFFICHES DANS LES IFRAMES
<SCRIPT LANGUAGE="JavaScript">
<!--
if (parent.frames.length < 1)
{
document.location.href = 'http://www.ekotec.fr/index.html';
nom_iframe = "http://www.ekotec.fr/actualites.html";
}
//-->
</SCRIPT>
J'ai également attaché à ma page principal deux fichiers javascript qui comportent les codes suivants
ieupdate.js
theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++) {
theObjects[i].outerHTML = theObjects[i].outerHTML;
}
iframessi.js
/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["maincontent"]
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="no"
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}
function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}
function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}
function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}
if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller
Merci pour ta réponse, mais l'include ne résout pas le problème
J'ai résolu en grande partie mon problème, en intégrant une iframe qui s'ajuste en fonction du contenu voici le résultat sur ce site www.ekotec.fr.
Cependant, il reste un hic qui se produit régulièrement sous IE (très rarement, il n'y a pas vraiment ce problème, c'est étrange). En fait, lorsque l'on clique sur un lien, la zone comporant le contenu s'agrandit, elle s'aggrandit de clic en clic
Merci pour votre aide
DANS LA PAGE CONTENANT L'IFRAME
<script type="text/javascript">
function adjustIFrameSize (iframeWindow) {
if (iframeWindow.document.height) {
var iframeElement = document.getElementById
(iframeWindow.name);
iframeElement.style.height = iframeWindow.document.height + 'px';
iframeElement.style.width = iframeWindow.document.width + 'px';
}
else if (document.all) {
var iframeElement = document.all[iframeWindow.name];
if (iframeWindow.document.compatMode &&
iframeWindow.document.compatMode != 'BackCompat')
{
iframeElement.style.height =
iframeWindow.document.documentElement.scrollHeight + 5 + 'px';
iframeElement.style.width =
iframeWindow.document.documentElement.scrollWidth + 5 + 'px';
}
else {
iframeElement.style.height =
iframeWindow.document.body.scrollHeight + 5 + 'px';
iframeElement.style.width =
iframeWindow.document.body.scrollWidth + 5 + 'px';
}
}
}
</script>
<iframe id="contenu" name="contenu" src="accueil.html" marginwidth="0" marginheight="0" align="middle" scrolling="Auto" frameborder="0" width="715"> <br />
Sorry your browser does not support Iframes. ekotec.fr makes extensive use of iFrames througout the site. In order to view it properly please update your browser.<br />
We recommend <a href="http://www.microsoft.com/downloads/searchdl.asp?" target="_blank">IE 5+</a> for both Mac and PC. Thanks!</font></iframe>
DANS LES PAGES DEVANT ETRE AFFICHES DANS LES IFRAMES
</SCRIPT>
</head>
<body onload="if (parent.adjustIFrameSize)
parent.adjustIFrameSize(window);MM_preloadImages('images/vignette-devis-2.gif')"
>
<script type="text/javascript">
POUR EMPECHER LE REFERENCE A INSERER DANS LES PAGES DEVANT ETRE AFFICHES DANS LES IFRAMES
<SCRIPT LANGUAGE="JavaScript">
<!--
if (parent.frames.length < 1)
{
document.location.href = 'http://www.ekotec.fr/index.html';
nom_iframe = "http://www.ekotec.fr/actualites.html";
}
//-->
</SCRIPT>
J'ai également attaché à ma page principal deux fichiers javascript qui comportent les codes suivants
ieupdate.js
theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++) {
theObjects[i].outerHTML = theObjects[i].outerHTML;
}
iframessi.js
/***********************************************
* IFrame SSI script II- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* Visit DynamicDrive.com for hundreds of original DHTML scripts
* This notice must stay intact for legal use
***********************************************/
//Input the IDs of the IFRAMES you wish to dynamically resize to match its content height:
//Separate each ID with a comma. Examples: ["myframe1", "myframe2"] or ["myframe"] or [] for none:
var iframeids=["maincontent"]
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="no"
var getFFVersion=navigator.userAgent.substring(navigator.userAgent.indexOf("Firefox")).split("/")[1]
var FFextraHeight=parseFloat(getFFVersion)>=0.1? 16 : 0 //extra height in px to add to iframe in FireFox 1.0+ browsers
function resizeCaller() {
var dyniframe=new Array()
for (i=0; i<iframeids.length; i++){
if (document.getElementById)
resizeIframe(iframeids[i])
//reveal iframe for lower end browsers? (see var above):
if ((document.all || document.getElementById) && iframehide=="no"){
var tempobj=document.all? document.all[iframeids[i]] : document.getElementById(iframeids[i])
tempobj.style.display="block"
}
}
}
function resizeIframe(frameid){
var currentfr=document.getElementById(frameid)
if (currentfr && !window.opera){
currentfr.style.display="block"
if (currentfr.contentDocument && currentfr.contentDocument.body.offsetHeight) //ns6 syntax
currentfr.height = currentfr.contentDocument.body.offsetHeight+FFextraHeight;
else if (currentfr.Document && currentfr.Document.body.scrollHeight) //ie5+ syntax
currentfr.height = currentfr.Document.body.scrollHeight;
if (currentfr.addEventListener)
currentfr.addEventListener("load", readjustIframe, false)
else if (currentfr.attachEvent){
currentfr.detachEvent("onload", readjustIframe) // Bug fix line
currentfr.attachEvent("onload", readjustIframe)
}
}
}
function readjustIframe(loadevt) {
var crossevt=(window.event)? event : loadevt
var iframeroot=(crossevt.currentTarget)? crossevt.currentTarget : crossevt.srcElement
if (iframeroot)
resizeIframe(iframeroot.id);
}
function loadintoIframe(iframeid, url){
if (document.getElementById)
document.getElementById(iframeid).src=url
}
if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller
3 messages
• Page 1 sur 1
Lectures recommandées sur ce thème :
- Google Custom Search Engine (CSE) : le moteur personnalisable de Google - 27-10-2006
- AdSense Tracking : statistiques détaillées sur les clics AdSense - 29-02-2004
- Concours WRI / Vivastreet : gagnez un voyage à New-York - 21-03-2005
- Annuaire WebRankInfo : nouvelle version enrichie de fonctionnalités - 12-04-2010
- Résultats des élections régionales 2010 sur Google Maps - 21-03-2010
- Google Friend Connect : présentation complète - 14-05-2008
Consultez la description détaillée des produits ou services de Google suivants : Google Custom Search Engine
Qui est en ligne
Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 0 invités
