Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Height Problem with Dynamic Iframe.
Old 02-23-2007, 06:28 PM Height Problem with Dynamic Iframe.
Freek's Avatar
Experienced Talker

Posts: 34
Name: Freek
Trades: 0
Hi !

I'm having a Height Problem with a Dynamic iFrame i'm using.
This means that not the whole site is displayed in height... but the width is good.

You can see the problem on my friends site:

How it should be:
http://www.mardescha-arabians.nl/index1.html

How it is (wrong):
http://www.mardescha-arabians.nl

This script is what i'm using:
http://www.dynamicdrive.com/dynamici...iframessi2.htm

Could someone please tell me what is wrong ?

Thanks !

PS: It also showes an ACTIVE X Warning.... why could that be ? For the music ?


__________________
Thanks, Freek.

Last edited by chrishirst; 03-21-2009 at 09:19 AM..
Freek is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-23-2007, 08:03 PM Re: Height Problem with Dynamic Iframe.
Experienced Talker

Posts: 35
Trades: 0
Right, make index.html, and put this in it, and upload.

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  <title>Mardescha-Arabians.nl</title>


  <script type="text/javascript">
/***********************************************
* 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=["myframe"]
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"
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
}
function onLoadPage() {if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller
}
  </script>
    <style type="text/css">
.style1 {
    border-width: 0;
}
</style>
</head>


<body onload="parent.onLoadPage();" style="margin: 0">

<iframe id="myframe" src="index1.html" marginwidth="0" marginheight="0" vspace="0" hspace="0" style="overflow: visible; width: 100%; height: 100%;" frameborder="0" scrolling="no"></iframe>
<center>
<embed src="http://mardescha-arabians.nl/muziek.mp3" autostart="true" loop="true" hidden="" class="style1" style="width: 1px; height: 1px"></center>

</body>
</html>
and it should work
eXistenZ is offline
Reply With Quote
View Public Profile
 
Old 02-24-2007, 06:26 AM Re: Height Problem with Dynamic Iframe.
Freek's Avatar
Experienced Talker

Posts: 34
Name: Freek
Trades: 0
Hi !

Thanks soo much !

It works in Firefox, but it doesn't work in IE strange enough,,,,
Could that be because IE whines because i'm using embedded music ?

I uploaded it , so that you can check it out:
http://www.mardescha-arabians.nl

Thanks again,

Freek.
__________________
Thanks, Freek.
Freek is offline
Reply With Quote
View Public Profile
 
Old 02-24-2007, 07:22 AM Re: Height Problem with Dynamic Iframe.
BruceWayne's Avatar
Extreme Talker

Posts: 182
Trades: 0
Can't see any problem there may be, it was already modified.
BruceWayne is offline
Reply With Quote
View Public Profile Visit BruceWayne's homepage!
 
Old 02-24-2007, 07:28 AM Re: Height Problem with Dynamic Iframe.
Freek's Avatar
Experienced Talker

Posts: 34
Name: Freek
Trades: 0
Quote:
Originally Posted by BruceWayne View Post
Can't see any problem there may be, it was already modified.
It works in Firefox, but in IE it has the same problem....

Thanks
__________________
Thanks, Freek.
Freek is offline
Reply With Quote
View Public Profile
 
Old 02-24-2007, 08:09 AM Re: Height Problem with Dynamic Iframe.
Hoosier_Buddy's Avatar
Extreme Talker

Posts: 204
Name: Justin Allen
Location: Corydon, IN
Trades: 0
Quote:
Originally Posted by Freek View Post
Hi !
Quote:
Originally Posted by Freek View Post

I'm having a Height Problem with a Dynamic iFrame i'm using.
This means that not the whole site is displayed in height... but the width is good.

You can see the problem on my friends site:

How it should be:
http://www.mardescha-arabians.nl/index1.html

How it is (wrong):
http://www.mardescha-arabians.nl

This script is what i'm using:
http://www.dynamicdrive.com/dynamici...iframessi2.htm

Could someone please tell me what is wrong ?

Thanks !

PS: It also showes an ACTIVE X Warning.... why could that be ? For the music ?

PPS: i told my friend this a lot of times to not use music (he owns the website) but he keeps saying:
If people don't want to hear my music, they turn their speakers off. I had alot of discussions about this.. So..


There is no height attribute add it after the width attribute ant that should fix your problem.

<iframe id="myframe" src="externalpage.htm" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; height:100%; display:none"></iframe>
__________________
Justin Allen
WebTeam

Please login or register to view this content. Registration is FREE
Hoosier_Buddy is offline
Reply With Quote
View Public Profile Visit Hoosier_Buddy's homepage!
 
Old 02-24-2007, 08:23 AM Re: Height Problem with Dynamic Iframe.
Freek's Avatar
Experienced Talker

Posts: 34
Name: Freek
Trades: 0
Quote:
Originally Posted by Hoosier_Buddy View Post

There is no height attribute add it after the width attribute ant that should fix your problem.

<iframe id="myframe" src="externalpage.htm" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" style="overflow:visible; width:100%; height:100%; display:none"></iframe>
Thanks for your tip.. i added it, still it isn't working in Internet Explorer.. It does work in FireFox though..

See it yourself @
http://mardescha-arabians.nl/

Thanks
__________________
Thanks, Freek.
Freek is offline
Reply With Quote
View Public Profile
 
Old 03-01-2007, 06:59 AM Re: Height Problem with Dynamic Iframe.
Freek's Avatar
Experienced Talker

Posts: 34
Name: Freek
Trades: 0
No-One ? I asked around on a other forum... they didn't know it aswell.

The script works now in FireFox but not in internet explorer;

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  <title>Mardescha-Arabians.nl</title>

  <script type="text/javascript">
/***********************************************
* 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=["myframe"]
//Should script hide iframe from browsers that don't support this script (non IE5+/NS6+ browsers. Recommended):
var iframehide="yes"
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
}
function onLoadPage() {if (window.addEventListener)
window.addEventListener("load", resizeCaller, false)
else if (window.attachEvent)
window.attachEvent("onload", resizeCaller)
else
window.onload=resizeCaller
}
  </script>
    <style type="text/css">
.style1 {
    border-width: 0;
}
</style>
</head>

<body onload="parent.onLoadPage();" style="margin: 0">
<iframe id="myframe" src="index1.html" marginwidth="0" marginheight="0" vspace="0" hspace="0" style="overflow: visible; width: 100%; height: 100%;" frameborder="0" scrolling="no"></iframe>
<center>
<embed src="http://mardescha-arabians.nl/muziek.mp3" autostart="true" loop="true" hidden="" class="style1" style="width: 1px; height: 1px"></center>
</body>
</html>
Thanks
__________________
Thanks, Freek.
Freek is offline
Reply With Quote
View Public Profile
 
Old 03-02-2007, 04:43 AM Re: Height Problem with Dynamic Iframe.
Novice Talker

Posts: 6
Name: Neil Oman
Trades: 0
how about this -
<script language="JavaScript">
<!--
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById('the_iframe').contentWindow.
document.body.scrollHeight;

//change the height of the iframe
document.getElementById('the_iframe').height=
the_height;
}
//-->
</script>
and in the body create the iframe tag: <iframe width="700" id="the_iframe"
onLoad="calcHeight();"
src="testing_page.shtml"
scrolling="NO"
frameborder="1"
height="1">
An iframe capable browser is
required to view this web site.
</iframe>
nellos121 is offline
Reply With Quote
View Public Profile
 
Old 03-02-2007, 11:41 AM Re: Height Problem with Dynamic Iframe.
Freek's Avatar
Experienced Talker

Posts: 34
Name: Freek
Trades: 0
Quote:
Originally Posted by nellos121 View Post
how about this -
Thank you sooo much !! It works as a charm !
I made a few adjustments to it, like no border and the width, and after that it really worked out good !

Thank you soo much again !!
__________________
Thanks, Freek.
Freek is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Height Problem with Dynamic Iframe.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.27497 seconds with 12 queries