Jump to content

Recommended Posts

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 :D

Link to comment
https://forums.phpfreaks.com/topic/156177-iframes/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/156177-iframes/#findComment-822194
Share on other sites

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();">

Link to comment
https://forums.phpfreaks.com/topic/156177-iframes/#findComment-822323
Share on other sites

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? :D

Link to comment
https://forums.phpfreaks.com/topic/156177-iframes/#findComment-822454
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.