Iframe Height Hack

makecg / 2010-04-26 12:45:51   

Hi

makecg / 2010-04-26 12:48:08   

This is for a Iframed Height hack I am using it doesn't work for IE though

My site is a testing grounds so if i remove thing. thats why.

View it on my site http://makecg.com

Code

  1. <style type='text/css'> 
  2. #content .container { padding: 0; }
  3. </style> 


function iframer()
{
    // get width of #content
    frame_x = $('#content').width();
    // get height of #menu
    frame_y = $('#menu').height();
    
    // apply height and width
    $('#iframed').css('width', frame_x);
    $('#iframed').css('height', frame_y);
}

$(document).ready( function() { iframer(); } );
$(window).resize( function() { iframer(); } );


makecg / 2010-04-26 12:49:45   

You know what guys, this whole code on forums is a little buggy. here is the code in a txt file

http://dl.dropbox.com/u/1690488/files/iframehack.txt

makecg / 2010-04-26 12:54:34   

I meant to say this here but posted it on my other thread OOPS~



Also in Exhibition Format place it as ( No Thumbs, No Captions )

Because you can't have any < p> inbetween the code it will automatically add those if you choose other ones.

Goneatdusk / 2011-06-08 21:47:08   

Great fix, surprised no one has picked up on this. Thanks!

Goneatdusk / 2011-06-08 21:48:48   

Is there a way to have the width fixed so that there is no horizontal scroll bar?

This thread has been closed, thank you.