annotate iframe-resizer/example/frame.absolute.html @ 11:092570578470 draft

Uploaded
author saskia-hiltemann
date Mon, 16 Nov 2015 10:23:34 -0500
parents 3c160414da2e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3c160414da2e initial upload
shiltemann
parents:
diff changeset
1 <!DOCTYPE html>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
2 <html>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
3 <head>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
4 <meta charset="utf-8">
3c160414da2e initial upload
shiltemann
parents:
diff changeset
5 <title>iFrame message passing test</title>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
6 <meta name="description" content="iFrame message passing test">
3c160414da2e initial upload
shiltemann
parents:
diff changeset
7 <style>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
8 a.back { float:right; }
3c160414da2e initial upload
shiltemann
parents:
diff changeset
9 body {border:solid 1px red;}
3c160414da2e initial upload
shiltemann
parents:
diff changeset
10 p{padding:5px 212px 5px 5px;margin:0 0 5px;}
3c160414da2e initial upload
shiltemann
parents:
diff changeset
11 #abs{
3c160414da2e initial upload
shiltemann
parents:
diff changeset
12 position: absolute;
3c160414da2e initial upload
shiltemann
parents:
diff changeset
13 top:0;
3c160414da2e initial upload
shiltemann
parents:
diff changeset
14 right:0;
3c160414da2e initial upload
shiltemann
parents:
diff changeset
15 width: 200px;
3c160414da2e initial upload
shiltemann
parents:
diff changeset
16 height: 600px;
3c160414da2e initial upload
shiltemann
parents:
diff changeset
17 background-color: wheat;
3c160414da2e initial upload
shiltemann
parents:
diff changeset
18 }
3c160414da2e initial upload
shiltemann
parents:
diff changeset
19 </style>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
20 </head>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
21 <body>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
22
3c160414da2e initial upload
shiltemann
parents:
diff changeset
23 <p>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
24 <b>iFrame</b>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
25 <a href="frame.content.html" class="back">Back to page 1</a>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
26 </p>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
27 <p>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
28 This page has an absolute position elemnt that take it out side the normal document body, which is marked with a red border on this page. This prevents the normal height calculation, which is based on the body tag from returning the correct height. To work around this you can set the <b>heightCalculationMethod</b> option to use one of the other page height propeties.
3c160414da2e initial upload
shiltemann
parents:
diff changeset
29 </p>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
30 <p>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
31 Use the dropdown to change the sizing method of the page, select the different sizing options to see how the effect the page. Note that they can have different effects in different browsers, so you are normally best off selecting <b>max</b> if you need to change away from the default <b>bodyOffset</b> option.
3c160414da2e initial upload
shiltemann
parents:
diff changeset
32 </p>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
33 <p>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
34 <b>Height Calculation Method</b>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
35 <select name="heightCalculationMethod">
3c160414da2e initial upload
shiltemann
parents:
diff changeset
36 <option>bodyOffset</option>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
37 <option>bodyScroll</option>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
38 <option>documentElementOffset</option>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
39 <option>documentElementScroll</option>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
40 <option>max</option>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
41 <option>min</option>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
42 <option>grow</option>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
43 <option>lowestElement</option>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
44 </select>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
45 </p>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
46 <p>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
47 <i>This option should be used sparingly, as the alternate methods can be less acurate at working out the correct page size, can cause screen flicker and can sometimes fail to reduce in size when the frame content changes in browsers that do not support mutationObservers (See <a href="http://caniuse.com/mutationobserver">caniuse.com</a> for details).</i>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
48 </p>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
49
3c160414da2e initial upload
shiltemann
parents:
diff changeset
50 <div id="abs">Absolute positioned element</div>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
51
3c160414da2e initial upload
shiltemann
parents:
diff changeset
52 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
53 <script type="text/javascript" src="../js/iframeResizer.contentWindow.min.js"></script>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
54 <script>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
55
3c160414da2e initial upload
shiltemann
parents:
diff changeset
56 $('select').on('change',function(){
3c160414da2e initial upload
shiltemann
parents:
diff changeset
57 if ('parentIFrame' in window){
3c160414da2e initial upload
shiltemann
parents:
diff changeset
58 parentIFrame.setHeightCalculationMethod($(this).val());
3c160414da2e initial upload
shiltemann
parents:
diff changeset
59 parentIFrame.size();
3c160414da2e initial upload
shiltemann
parents:
diff changeset
60 }
3c160414da2e initial upload
shiltemann
parents:
diff changeset
61 });
3c160414da2e initial upload
shiltemann
parents:
diff changeset
62
3c160414da2e initial upload
shiltemann
parents:
diff changeset
63 </script>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
64
3c160414da2e initial upload
shiltemann
parents:
diff changeset
65 </body>
3c160414da2e initial upload
shiltemann
parents:
diff changeset
66 </html>