forked from house9/jquery-iframe-auto-height
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dynamic.html
54 lines (44 loc) · 2.01 KB
/
dynamic.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
<!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 Dynamic</title>
<link rel="stylesheet" type="text/css" media="all" href="css/master.css" />
<script type="text/javascript" src="../demo_on_rails/app/assets/javascripts/lib/jquery-1.6.2.js"></script>
<script type="text/javascript" src="../demo_on_rails/app/assets/javascripts/src/jquery.iframe-auto-height.plugin.js"></script>
<script>
$(document).ready(function () {
$("#load-iframe-link").click(function () {
$("<iframe />").attr("src", "iframe_2.html").attr("frameborder", 0).attr("width", "750px").attr("height", "200px").appendTo("#iframe-container");
$('iframe').iframeAutoHeight({heightOffset: 40});
});
$("#remove-iframe-link").click(function () {
$("#iframe-container iframe").remove();
});
$("#change-iframe-link").click(function () {
$("#iframe-container iframe").attr("src", "iframe_6.html");
});
});
</script>
</head>
<body>
<div id="container">
<h1>
jQuery » iFrame Sizing Dynamic
</h1>
<div style="margin-top: 20px">
<a href="javascript: void(0);" id="load-iframe-link">Load iframe</a> |
<a href="javascript: void(0);" id="remove-iframe-link">Remove iframe</a> |
<a href="javascript: void(0);" id="change-iframe-link">Change iframe</a> |
</div>
<div style="height: 60px">
</div>
<div id="iframe-container" style="border:1px solid black; background-color:gray">
<!-- load iframe here -->
</div>
<div class="clear"> </div>
</div><!-- end #container -->
<br />
</body>
</html>