annotate iframe-resizer/test/resources/frame.nested.html @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 <!DOCTYPE html>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 <html>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3 <head>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 <meta charset="utf-8">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 <title>iFrame message passing test</title>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 <meta name="description" content="iFrame message passing test">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 <meta name="viewport" content="width=device-width">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 <meta http-equiv="X-UA-Compatible" content="IE=edge">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 <script type="text/javascript">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 //MDN PolyFil for IE8 (This is not needed if you use the jQuery version)
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11 if (!Array.prototype.forEach){
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 Array.prototype.forEach = function(fun /*, thisArg */){
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 "use strict";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 if (this === void 0 || this === null || typeof fun !== "function") throw new TypeError();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 var
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 t = Object(this),
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 len = t.length >>> 0,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 thisArg = arguments.length >= 2 ? arguments[1] : void 0;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 for (var i = 0; i < len; i++)
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 if (i in t)
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 fun.call(thisArg, t[i], i, t);
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 };
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 </script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 <style>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 *, *:before, *:after {box-model: border-box;}
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 a { float:right; margin-left:10px;}
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 h2 {margin-top: 0;}
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 </style>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 </head>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 <body>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 <h2>Nested iFrame</h2>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 <p>Resize window or click one of the links in the nested iFrame to watch it resize.</p>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 <div style="margin:20px;">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 <iframe id="nestedIFrame" src="frame.content.html" width="100%" scrolling="no"></iframe>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 </div>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 <p id="callback">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 </p>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 <script type="text/javascript" src="../../js/iframeResizer.contentWindow.min.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 <script src="jquery.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 <script type="text/javascript" src="../../js/iframeResizer.min.js"></script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 <script type="text/javascript">
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 iFrameResize({
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 log : true, // Enable console logging
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 resizedCallback : function(messageData){ // Callback fn when message is received
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 setTimeout(function(){parentIFrame.sendMessage('nested')},50);
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 });
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 </script>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 </body>
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 </html>