Set height for iFrame using jquery
$(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
});
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
});
Subscribe to:
Post Comments
(
Atom
)
Great beat ! I would like to apprentice whilst you amend
ReplyDeleteyour 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
Fantastic items from you, man. I've remember your stuff prior to and you are just too
ReplyDeletefantastic. 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.
I was suggested this web site by my cousin. I'm
ReplyDeletenot sure whether this post is written by him as nobody else
know such detailed about my problem. You are amazing!
Thanks!
Does your site have a contact page? I'm having a tough time locating it but, I'd like to shoot you
ReplyDeletean 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.
Hi to every body, it's my first visit of this blog;
ReplyDeletethis blog consists of awesome and truly good stuff designed
for visitors.
Hmm it appears like your blog ate my first comment (it
ReplyDeletewas 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.
Very quickly this web page will be famous amid all blog people, due
ReplyDeleteto it's pleasant posts
wonderful post, very informative. I'm wondering why the opposite specialists
ReplyDeleteof this sector don't notice this. You must proceed your writing.
I'm sure, you have a huge readers' base already!
This is a really good tip particularly to those fresh to the blogosphere.
ReplyDeleteSimple but very accurate info… Thank you for sharing
this one. A must read post!
Admiring the hard work you put into your website and in depth information you offer.
ReplyDeleteIt'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.
Thanks for finally talking about >"Set height for iFrame using jquery" <Liked it!
ReplyDeletePretty! This has been a really wonderful article. Many thanks for providing these details.
ReplyDeleteI absolutely love your blog and find nearly all of your post's to be just what I'm looking for.
ReplyDeleteWould 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!
Hey There. I discovered your blog using msn. This is a very smartly written article.
ReplyDeleteI will make sure to bookmark it and return to read extra of your helpful info.
Thank you for the post. I'll definitely comeback.
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
ReplyDeletelot and don't manage to get anything done.