Iframe gets visible size

Inside the iframe, I need to figure out what exactly the visual size is (using js or jquery).

This example shows only the iframe part. The iframe is 300x300 in size, but the div limits it to 300x100.

<div style="max-width: 300px; max-height: 100px; overflow: hidden">
<iframe width="300" height="300" src="http://www.rapidtables.com/web/tools/window-size.htm" style="border:none"></iframe>
</div>

      

How can I determine the actual visible dimensions inside the iframe?

Tried

window.clientHeight
window.outerHeight
window.innerHeight
window.availableHeight
$(window).height();

      

+3
javascript jquery html css


source to share


No one has answered this question yet

See similar questions:

15
How to get the height of an iframe with javascript from within an iframe? How about pages with multiple iframes?

or similar:

3796
How do you get the timestamp in JavaScript?
2853
Get the current url using JavaScript?
2701
How do I get the values ​​of a query string in JavaScript?
2170
How do I get children from the $ (this) selector?
2132
Get selected text from dropdown (select field) using jQuery
1904
Get the size of the screen, current web page and browser window
1690
Get current url using jQuery?
1061
How can I check if an element is visible after scrolling?
960
How do I apply CSS to an iframe?
102
How to make div grow in height when floated inside



All Articles
Loading...
X
Show
Funny
Dev
Pics