forked from house9/jquery-iframe-auto-height
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (57 loc) · 2.85 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>jQuery » iFrame Sizing</title>
<link rel="stylesheet" type="text/css" media="all" href="css/master.css" />
<script type="text/javascript" src="js/jquery-1.4.3.min.js"></script>
<script type="text/javascript" src="js/jquery.iframe-auto-height.plugin.js"></script>
</head>
<body>
<div id="container">
<h1>
jQuery » iFrame Sizing
</h1>
<p>
This demo uses <a href="http://jquery.com/">jQuery</a> to dynamically size iframes based on content height.
Original code by Nathan Smith, see <a href="http://sonspring.com/journal/jquery-iframe-sizing">original article</a>.
</p>
<p>
Now a jquery plugin, download from github <a href="http://github.com/house9/jquery-iframe-auto-height">http://github.com/house9/jquery-iframe-auto-height</a>
and view the README file.
</p>
<p>
Best viewed locally with Firefox.
</p>
<iframe src="panoramic.html" class="photo" scrolling="no" frameborder="0"></iframe>
<iframe src="iframe_1.html" class="column" scrolling="no" frameborder="0"></iframe>
<iframe src="iframe_1.html" class="column" scrolling="no" frameborder="0"></iframe>
<iframe src="iframe_1.html" class="column" scrolling="no" frameborder="0"></iframe>
<iframe src="iframe_1.html" class="column" scrolling="no" frameborder="0"></iframe>
<div class="clear"> </div>
<iframe src="iframe_2.html" class="column" scrolling="no" frameborder="0"></iframe>
<iframe src="iframe_2.html" class="column" scrolling="no" frameborder="0"></iframe>
<iframe src="iframe_2.html" class="column" scrolling="no" frameborder="0"></iframe>
<iframe src="iframe_2.html" class="column" scrolling="no" frameborder="0"></iframe>
<div class="clear"> </div>
</div>
<!-- end #container -->
<script type="text/javascript">
// match all iframes / use jQuery or alias $
jQuery('iframe').iframeAutoHeight();
// only panoramic.html iframe with some extra height
// $('iframe.photo').iframeAutoHeight({heightOffset: 50});
// NOTES: you can wrap this in document ready if you like
// but IE8 didn't always like it
</script>
<!--
on chrome on mac get this error when viewing locally
Unsafe JavaScript attempt to access frame with U
RL file:///.../jquery-iframe-auto-height/iframe_2.html
from frame with URL file:///.../jquery-iframe-auto-height/index.html.
Domains, protocols and ports must match.
should be fine when code is served from a web server
view with firefox locally
-->
</body>
</html>