zero_ZX Posted April 29, 2009 Share Posted April 29, 2009 Hi all, Not sure if i do this right, but im trying to make a guild site, and i want my site to be viewable all the time, so i putted my forums into iframe which returns: http://www.pgservers.co.cc/forums.html Case is, i dont want scrollbars, but i want my user to view all of the content within my iframe.. Is this possible? if so, how would i do so? (real location to forum is http://www.pgservers.co.cc/forums) and as you see, there's a lot of "un-used space". I picked this skin because of that since i though it wasn't nessacary to have inside my iframe.. Thanks for your very appriciated help Quote Link to comment https://forums.phpfreaks.com/topic/156177-iframes/ Share on other sites More sharing options...
Ken2k7 Posted April 29, 2009 Share Posted April 29, 2009 Well, you set the iFrame height to be 1500, so that's the reason behind the extra spaces below the forum. Even if you lower that number to like 1000, it may look fine on the index page, but if you go into a topic page that's longer than 1000px in height, you'll end up with the same problem. And iFrames don't auto adjust to height and width. There's really no way to get it perfect without using scrollbars. Quote Link to comment https://forums.phpfreaks.com/topic/156177-iframes/#findComment-822194 Share on other sites More sharing options...
neogemima Posted April 29, 2009 Share Posted April 29, 2009 Ken2k7, is incorrect. You can use some simple javascript to adjust the height of your iframe, or width with some tweaking. Basically, just put this script into the header of your file: <script language="JavaScript"> <!-- function calcHeight() { //find the height of the internal page var the_height= document.getElementById('youriframe').contentWindow. document.body.scrollHeight; //change the height of the iframe document.getElementById('youriframe').height= the_height; } //--> </script> Simple as that. Then in your iframe tag include: <iframe name="youriframe" onload="calcheight();"> Quote Link to comment https://forums.phpfreaks.com/topic/156177-iframes/#findComment-822323 Share on other sites More sharing options...
zero_ZX Posted April 30, 2009 Author Share Posted April 30, 2009 Thanks, but the script didn't really fix anything <script language="JavaScript"> <!-- function calcHeight() { //find the height of the internal page var the_height= document.getElementById('forums').contentWindow. document.body.scrollHeight; //change the height of the iframe document.getElementById('forums').height= the_height; } //--> </script> <iframe name="forums" onload="calcheight();" style="FILTER: chroma (color=#E9FE03);" src="/forums" frameborder="0" noresize framemargin="0" allowtransparency scrolling= "no"> I guess im incorrect? Quote Link to comment https://forums.phpfreaks.com/topic/156177-iframes/#findComment-822454 Share on other sites More sharing options...
FaT3oYCG Posted April 30, 2009 Share Posted April 30, 2009 give the iframe an id tag i.e. <iframe name="forums" id="forums" onload="calcheight();" style="FILTER: chroma (color=#E9FE03);" src="/forums" frameborder="0" noresize framemargin="0" allowtransparency scrolling= "no"> Quote Link to comment https://forums.phpfreaks.com/topic/156177-iframes/#findComment-822470 Share on other sites More sharing options...
zero_ZX Posted April 30, 2009 Author Share Posted April 30, 2009 thanks, but i can only see a very little cornor now.. Quote Link to comment https://forums.phpfreaks.com/topic/156177-iframes/#findComment-822648 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.