Loading repository data…
Loading repository data…
kulikala / repository
An extra light weight pure JavaScript library to automatically adjust the iframe height to its contents height. What you need is just write a script tag to load adjustiframeheight.js in the inner page. Supports periodical updates of the height of the iframe.
An extra light weight pure JavaScript library to automatically adjust the iframe height to its contents height.
What you need is just write a script tag to load adjustiframeheight.js in the inner page.
Supports periodical updates of the height of the iframe.
-- The outer page --
<html>
<head>
...
</head>
<body>
...
<iframe src="( the relative url to the inner page )"></iframe>
...
</body>
</html>
-- The inner page --
<html>
<head>
...
<script type="text/javascript" src="adjustiframeheight.js"></script>
...
</head>
<body>
...
</body>
</html>
You need to load aajustiframeheight-co.js in the outer page if the inner page of the iframe comes from another domain. See the section below.
Google Chrome will throw security error when either the outer page or the inner page comes from local, i.e. the protocol is file:. This script works fine with local files in Firefox, Safari, Opera, and IE.
Do not set margin to the root html element of the inner page. This script cannot handle the margin except Firefox.
-- The outer page --
<html>
<head>
...
<script type="text/javascript" src="adjustiframeheight-co.js"></script>
...
</head>
<body>
...
<iframe src="( the absolute url of the inner page )"></iframe>
...
</body>
</html>
v2.0 / 2013-03-11
v1.0.1 / 2011-11-02
v1.0 / 2011-10-29
See LICENSE
Copyright (C) 2013 Kulikala.