jotgabbi Posted October 23, 2009 Share Posted October 23, 2009 I dont know whether this will be more CSS or javascript, but here goes. I have a page and when you click on a link, it opens a floating div 1000px wide which contains another page in an iframe. The problem I have is, each page is a different height so I can't just set a height to the iframe. I have used abit of javascript which I have put in the parent page. <script language="JavaScript"> <!-- function calcHeight() { //find the height of the internal page var the_height= document.getElementById('resize').contentWindow. document.body.scrollHeight; //change the height of the iframe document.getElementById('resize').height= the_height; } //--> </script> This works to an extent, but on my pages, there are divs, that it doesn't seem to pick up the height for, causing me to use <BR> hacks to push page down. Also there are hidden divs that appear when buttons pressed, which pushs the page down, but this does not cause the iframe to change height as required, and pushs some of the content out the iframe, which has scrolling OFF, so cant be accessed. Any ideas on the best way to approach this problem? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/ Share on other sites More sharing options...
nadeemshafi9 Posted October 23, 2009 Share Posted October 23, 2009 u nead a <div style="clear:both"></div> inside the iframe this will flush it Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-942713 Share on other sites More sharing options...
jotgabbi Posted October 23, 2009 Author Share Posted October 23, 2009 <iframe src="journeys.html" onLoad="calcHeight();" scrolling="NO" frameborder="1" width="760" height="200" name="resize" id="resize"><div style="clear:both"></div></iframe> is now what my iframe looks like but with no success or changes. Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-942722 Share on other sites More sharing options...
nadeemshafi9 Posted October 23, 2009 Share Posted October 23, 2009 <iframe src="journeys.html" onLoad="calcHeight();" scrolling="NO" frameborder="1" width="760" height="200" name="resize" id="resize"> <div> the page <div style="clear:both"></div> </div> </iframe> Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-942757 Share on other sites More sharing options...
jotgabbi Posted October 23, 2009 Author Share Posted October 23, 2009 Nope, that made no effect at all. I'm going to have to give up and just let it look tacky with a scroll bar aren't i Is there anyway in which case, of if the iframe scroll is set to auto, and the page requires scrolling... the scrollbar for the entire page is disabled while the floating div is visible. Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-942791 Share on other sites More sharing options...
nadeemshafi9 Posted October 23, 2009 Share Posted October 23, 2009 <iframe src="journeys.html" onLoad="calcHeight();" scrolling="NO" frameborder="1" width="760" height="200" name="resize" id="resize"> <div> <div style="float: left"> the page </div> <div style="clear:both"></div> </div> </iframe> Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-942812 Share on other sites More sharing options...
Adam Posted October 23, 2009 Share Posted October 23, 2009 I'm going to have to give up and just let it look tacky with a scroll bar aren't i Perhaps think about why you never see other pages with scroll bars in the middle? There are many other methods to *including* content into a template, without the use of frames or having to update 20 pages for a single change. Take a look at PHP includes (personally I prefer require_once to include files). Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-942821 Share on other sites More sharing options...
jotgabbi Posted October 23, 2009 Author Share Posted October 23, 2009 The div holding the iframe is floating, to appear like a pop up in sense.. it loads up their control panel. I'm iframing in from another server where the portal is held. So can't use include. I'm going to have to give up and just let it look tacky with a scroll bar aren't i Perhaps think about why you never see other pages with scroll bars in the middle? There are many other methods to *including* content into a template, without the use of frames or having to update 20 pages for a single change. Take a look at PHP includes (personally I prefer require_once to include files). Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-942868 Share on other sites More sharing options...
Adam Posted October 23, 2009 Share Posted October 23, 2009 .... touché Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-942880 Share on other sites More sharing options...
jotgabbi Posted October 23, 2009 Author Share Posted October 23, 2009 here it is www.bigggg.com/iframe.html notice how it works now the first time you click on the graph symbol. if you then click on the "october" link.. then go back in browser... or reload the website... the iframe doesn't adjust no more.. Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-942897 Share on other sites More sharing options...
nadeemshafi9 Posted October 24, 2009 Share Posted October 24, 2009 iv used fusion charts many times befre and i had the problem solved but i just dont have teh code, what iv given you is what i started off from to reach teh solution., when i used the charts they were all over the place, there are issues with SPACES and floating. Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-943394 Share on other sites More sharing options...
nadeemshafi9 Posted October 24, 2009 Share Posted October 24, 2009 so you think ur bad with ur javascript hahahaha Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-943395 Share on other sites More sharing options...
jotgabbi Posted October 24, 2009 Author Share Posted October 24, 2009 so you think ur bad with ur javascript hahahaha what u mean? Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-943688 Share on other sites More sharing options...
nadeemshafi9 Posted October 26, 2009 Share Posted October 26, 2009 so you think ur bad with ur javascript hahahaha what u mean? as in you are very proud of the javascript you have done but i think you should use a framewok, if your gona be having buttons that change content in the current document you need more interactive responses from the interface, and maybe they will have popups that will hot it properly Quote Link to comment https://forums.phpfreaks.com/topic/178713-floating-divs-iframes-and-javascript/#findComment-944374 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.