Set height for iFrame using jquery

15 comments
$(document).ready(function () {
var height = $(window.frameElement).height(); // Calculate the window height
var minheight = $(window.frameElement).height(); // Calculate the window min-height
$(window.top.document).find('iframe').css("height", (height - 20) + "px"); // Calculated window height - header height + footer height + padding + margin , then you will get the remaining height for the main container
$(window.top.document).find('iframe').css("min-height", (minheight - 20) + "px"); // Calculated window minheight - header height + footer height + padding + margin , then you will get the remaining min-height for the main container
$(window.top.document).find('iframe').css("width", "100%");
});

// Resize Function
$(window).resize(function () {
var height = $(window.frameElement).height(); // Calculate the window height
var minheight = $(window.frameElement).height(); // Calculate the window min-height
$(window.top.document).find('iframe').css("height", (height - 20) + "px"); // Calculated window height - header height + footer height + padding + margin , then you will get the remaining height for the main container
$(window.top.document).find('iframe').css("min-height", (minheight - 20) + "px"); // Calculated window minheight - header height + footer height + padding + margin , then you will get the remaining min-height for the main container
});

15 comments :

  1. Great beat ! I would like to apprentice whilst you amend
    your website, how can i subscribe for a blog web site? The account aided me a appropriate deal.
    I had been a little bit acquainted of this your broadcast offered
    brilliant clear idea

    ReplyDelete
  2. Fantastic items from you, man. I've remember your stuff prior to and you are just too
    fantastic. I really like what you've obtained here, certainly like what you're saying and
    the way through which you say it. You make it enjoyable and you still
    take care of to stay it sensible. I cant wait to read much more from you.

    That is actually a wonderful web site.

    ReplyDelete
  3. I was suggested this web site by my cousin. I'm
    not sure whether this post is written by him as nobody else
    know such detailed about my problem. You are amazing!
    Thanks!

    ReplyDelete
  4. Does your site have a contact page? I'm having a tough time locating it but, I'd like to shoot you
    an e-mail. I've got some suggestions for your blog you might be interested in hearing.

    Either way, great website and I look forward to seeing it develop over
    time.

    ReplyDelete
  5. Hi to every body, it's my first visit of this blog;
    this blog consists of awesome and truly good stuff designed
    for visitors.

    ReplyDelete
  6. Hmm it appears like your blog ate my first comment (it
    was extremely long) so I guess I'll just sum
    it up what I had written and say, I'm thoroughly enjoying your blog.

    I as well am an aspiring blog writer but I'm still new to everything.

    Do you have any points for newbie blog writers? I'd genuinely appreciate it.

    ReplyDelete
  7. Very quickly this web page will be famous amid all blog people, due
    to it's pleasant posts

    ReplyDelete
  8. wonderful post, very informative. I'm wondering why the opposite specialists
    of this sector don't notice this. You must proceed your writing.

    I'm sure, you have a huge readers' base already!

    ReplyDelete
  9. This is a really good tip particularly to those fresh to the blogosphere.

    Simple but very accurate info… Thank you for sharing
    this one. A must read post!

    ReplyDelete
  10. Admiring the hard work you put into your website and in depth information you offer.
    It's nice to come across a blog every once in a while that isn't the same outdated rehashed material.

    Fantastic read! I've saved your site and I'm adding your RSS feeds to
    my Google account.

    ReplyDelete
  11. Thanks for finally talking about >"Set height for iFrame using jquery" <Liked it!

    ReplyDelete
  12. Pretty! This has been a really wonderful article. Many thanks for providing these details.

    ReplyDelete
  13. I absolutely love your blog and find nearly all of your post's to be just what I'm looking for.

    Would you offer guest writers to write content for yourself?

    I wouldn't mind creating a post or elaborating on a
    number of the subjects you write in relation to
    here. Again, awesome blog!

    ReplyDelete
  14. Hey There. I discovered your blog using msn. This is a very smartly written article.
    I will make sure to bookmark it and return to read extra of your helpful info.

    Thank you for the post. I'll definitely comeback.

    ReplyDelete
  15. Aw, this was an extremely good post. Taking the time and actual effort to make a superb article… but what can I say… I procrastinate a
    lot and don't manage to get anything done.

    ReplyDelete