j1m_scroll 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.md +21 -0
  3. data/README.md +41 -0
  4. data/_data/modules/default/j1_scroll-0.0.1/j1_back2top.yml +131 -0
  5. data/_data/modules/default/j1_scroll-0.0.1/j1_smooth_scroll.yml +162 -0
  6. data/_data/resources/default/j1_scroll-0.0.1/resource.yml +43 -0
  7. data/assets/themes/j1/iframe_resizer/.npmignore +9 -0
  8. data/assets/themes/j1/iframe_resizer/.travis.yml +6 -0
  9. data/assets/themes/j1/iframe_resizer/CONTRIBUTING.md +86 -0
  10. data/assets/themes/j1/iframe_resizer/Iframe-resizer by davidjbradshaw.url +2 -0
  11. data/assets/themes/j1/iframe_resizer/LICENSE +21 -0
  12. data/assets/themes/j1/iframe_resizer/README.md +608 -0
  13. data/assets/themes/j1/iframe_resizer/bower.json +45 -0
  14. data/assets/themes/j1/iframe_resizer/example/frame.absolute.html +88 -0
  15. data/assets/themes/j1/iframe_resizer/example/frame.content.html +58 -0
  16. data/assets/themes/j1/iframe_resizer/example/frame.hover.html +51 -0
  17. data/assets/themes/j1/iframe_resizer/example/frame.nested.html +72 -0
  18. data/assets/themes/j1/iframe_resizer/example/frame.textarea.html +46 -0
  19. data/assets/themes/j1/iframe_resizer/example/frame.tolerance.html +79 -0
  20. data/assets/themes/j1/iframe_resizer/example/index.html +70 -0
  21. data/assets/themes/j1/iframe_resizer/example/two.html +71 -0
  22. data/assets/themes/j1/iframe_resizer/gruntfile.js +215 -0
  23. data/assets/themes/j1/iframe_resizer/iframeResizer.jquery.json +41 -0
  24. data/assets/themes/j1/iframe_resizer/index.js +4 -0
  25. data/assets/themes/j1/iframe_resizer/js/_client.js +1131 -0
  26. data/assets/themes/j1/iframe_resizer/js/_server.js +1126 -0
  27. data/assets/themes/j1/iframe_resizer/js/ie8.polyfils.js +85 -0
  28. data/assets/themes/j1/iframe_resizer/js/ie8.polyfils.map +1 -0
  29. data/assets/themes/j1/iframe_resizer/js/ie8.polyfils.min.js +4 -0
  30. data/assets/themes/j1/iframe_resizer/js/iframeResizer.contentWindow.js +1104 -0
  31. data/assets/themes/j1/iframe_resizer/js/iframeResizer.contentWindow.map +1 -0
  32. data/assets/themes/j1/iframe_resizer/js/iframeResizer.contentWindow.min.js +10 -0
  33. data/assets/themes/j1/iframe_resizer/js/iframeResizer.js +1007 -0
  34. data/assets/themes/j1/iframe_resizer/js/iframeResizer.js.modified +1004 -0
  35. data/assets/themes/j1/iframe_resizer/js/iframeResizer.map +1 -0
  36. data/assets/themes/j1/iframe_resizer/js/iframeResizer.min.js +9 -0
  37. data/assets/themes/j1/iframe_resizer/js/index.js +2 -0
  38. data/assets/themes/j1/iframe_resizer/karma.conf.js +92 -0
  39. data/assets/themes/j1/iframe_resizer/package.json +111 -0
  40. data/assets/themes/j1/iframe_resizer/spec/_initSpec.js +63 -0
  41. data/assets/themes/j1/iframe_resizer/spec/anchorSpec.js +62 -0
  42. data/assets/themes/j1/iframe_resizer/spec/childSpec.js +403 -0
  43. data/assets/themes/j1/iframe_resizer/spec/closeSpecSpec.js +44 -0
  44. data/assets/themes/j1/iframe_resizer/spec/getPageInfoSpec.js +32 -0
  45. data/assets/themes/j1/iframe_resizer/spec/initCssSpec.js +28 -0
  46. data/assets/themes/j1/iframe_resizer/spec/initDomSpec.js +27 -0
  47. data/assets/themes/j1/iframe_resizer/spec/initDoubleCallSpec.js +33 -0
  48. data/assets/themes/j1/iframe_resizer/spec/initErrorSpec.js +57 -0
  49. data/assets/themes/j1/iframe_resizer/spec/initJQuerySpec.js +29 -0
  50. data/assets/themes/j1/iframe_resizer/spec/initUndefinedDomSpec.js +25 -0
  51. data/assets/themes/j1/iframe_resizer/spec/javascripts/fixtures/iframe.html +2 -0
  52. data/assets/themes/j1/iframe_resizer/spec/javascripts/fixtures/iframe600.html +4 -0
  53. data/assets/themes/j1/iframe_resizer/spec/javascripts/fixtures/iframe600WithId.html +4 -0
  54. data/assets/themes/j1/iframe_resizer/spec/lib/common.js +59 -0
  55. data/assets/themes/j1/iframe_resizer/spec/parentSpec.js +88 -0
  56. data/assets/themes/j1/iframe_resizer/spec/resources/djb.jpg +0 -0
  57. data/assets/themes/j1/iframe_resizer/spec/resources/frame.content.html +176 -0
  58. data/assets/themes/j1/iframe_resizer/spec/resources/frame.lateload.html +33 -0
  59. data/assets/themes/j1/iframe_resizer/spec/resources/frame.nested.html +40 -0
  60. data/assets/themes/j1/iframe_resizer/spec/scrollSpec.js +53 -0
  61. data/assets/themes/j1/iframe_resizer/spec/sendMessageSpec.js +58 -0
  62. data/assets/themes/j1/iframe_resizer/spec/support/jasmine.json +9 -0
  63. data/assets/themes/j1/iframe_resizer/src/ie8.polyfils.js +64 -0
  64. data/assets/themes/j1/iframe_resizer/src/iframeResizer.contentWindow.js +1123 -0
  65. data/assets/themes/j1/iframe_resizer/src/iframeResizer.js +1002 -0
  66. data/assets/themes/j1/iframe_resizer/test-main.js +33 -0
  67. data/assets/themes/j1/iframe_resizer/test/_init.html +44 -0
  68. data/assets/themes/j1/iframe_resizer/test/_init_once.html +45 -0
  69. data/assets/themes/j1/iframe_resizer/test/_init_once_async.html +72 -0
  70. data/assets/themes/j1/iframe_resizer/test/background.html +47 -0
  71. data/assets/themes/j1/iframe_resizer/test/changePage.html +50 -0
  72. data/assets/themes/j1/iframe_resizer/test/close.html +44 -0
  73. data/assets/themes/j1/iframe_resizer/test/getId.html +44 -0
  74. data/assets/themes/j1/iframe_resizer/test/interval.html +56 -0
  75. data/assets/themes/j1/iframe_resizer/test/jqueryNoConflict.html +47 -0
  76. data/assets/themes/j1/iframe_resizer/test/lateImageLoad.html +90 -0
  77. data/assets/themes/j1/iframe_resizer/test/margin.html +73 -0
  78. data/assets/themes/j1/iframe_resizer/test/mutationObserver.html +63 -0
  79. data/assets/themes/j1/iframe_resizer/test/nested.html +46 -0
  80. data/assets/themes/j1/iframe_resizer/test/resize.contentWidth.html +51 -0
  81. data/assets/themes/j1/iframe_resizer/test/resize.width.html +63 -0
  82. data/assets/themes/j1/iframe_resizer/test/resources/djb.jpg +0 -0
  83. data/assets/themes/j1/iframe_resizer/test/resources/frame.content.html +191 -0
  84. data/assets/themes/j1/iframe_resizer/test/resources/frame.lateload.html +33 -0
  85. data/assets/themes/j1/iframe_resizer/test/resources/frame.nested.html +40 -0
  86. data/assets/themes/j1/iframe_resizer/test/resources/jquery.js +6 -0
  87. data/assets/themes/j1/iframe_resizer/test/resources/qunit.css +244 -0
  88. data/assets/themes/j1/iframe_resizer/test/resources/qunit.js +2212 -0
  89. data/assets/themes/j1/iframe_resizer/test/resources/require.js +2103 -0
  90. data/assets/themes/j1/iframe_resizer/test/resources/testLib.js +9 -0
  91. data/assets/themes/j1/iframe_resizer/test/scrolling.html +65 -0
  92. data/assets/themes/j1/iframe_resizer/test/sendMessage.html +61 -0
  93. data/assets/themes/j1/iframe_resizer/test/setHeightCalculationMethod.html +51 -0
  94. data/assets/themes/j1/iframe_resizer/test/size.html +64 -0
  95. data/assets/themes/j1/iframe_resizer/test/v1.html +189 -0
  96. data/assets/themes/j1/j1/js/adapters/iframe_resizer.js +105 -0
  97. data/exe/console +14 -0
  98. data/exe/setup +8 -0
  99. data/lib/j1m_scroll.rb +5 -0
  100. data/lib/j1m_scroll/version.rb +3 -0
  101. metadata +190 -0
@@ -0,0 +1,2 @@
1
+ [InternetShortcut]
2
+ URL=http://davidjbradshaw.github.io/iframe-resizer/
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013-2015 David J. Bradshaw
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,608 @@
1
+ # iFrame Resizer
2
+ [![NPM version](https://badge.fury.io/js/iframe-resizer.svg)](http://badge.fury.io/js/iframe-resizer)
3
+ [![Bower version](https://badge.fury.io/bo/iframe-resizer.svg)](http://badge.fury.io/bo/iframe-resizer)
4
+ [![Build Status](https://travis-ci.org/davidjbradshaw/iframe-resizer.svg?branch=master)](https://travis-ci.org/davidjbradshaw/iframe-resizer)
5
+ [![Coverage Status](https://coveralls.io/repos/davidjbradshaw/iframe-resizer/badge.svg?branch=master&service=github)](https://coveralls.io/github/davidjbradshaw/iframe-resizer)
6
+
7
+ This library enables the automatic resizing of the height and width of both same and cross domain iFrames to fit their contained content. It provides a range of features to address the most common issues with using iFrames, these include:
8
+
9
+ * Height and width resizing of the iFrame to content size.
10
+ * Works with multiple and nested iFrames.
11
+ * Domain authentication for cross domain iFrames.
12
+ * Provides a range of page size calculation methods to support complex CSS layouts.
13
+ * Detects changes to the DOM that can cause the page to resize using [MutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver).
14
+ * Detects events that can cause the page to resize (Window Resize, CSS Animation and Transition, Orientation Change and Mouse events).
15
+ * Simplified messaging between iFrame and host page via [postMessage](https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage).
16
+ * Fixes in page links in iFrame and supports links between the iFrame and parent page.
17
+ * Provides custom sizing and scrolling methods.
18
+ * Exposes parent position and viewport size to the iFrame.
19
+ * Works with [ViewerJS](http://viewerjs.org/) to support PDF and ODF documents.
20
+ * Fallback support down to IE8.
21
+
22
+ ### Install
23
+
24
+ This package can be installed via NPM (`npm install iframe-resizer -save`) or Bower (`bower install iframe-resizer`).
25
+
26
+ ### Getting started
27
+ The package contains two minified JavaScript files in the [js](js) folder. The first ([iframeResizer.min.js](https://raw.githubusercontent.com/davidjbradshaw/iframe-resizer/master/js/iframeResizer.min.js)) is for the page hosting the iFrames. It can be called with **native** JavaScript;
28
+
29
+ ```js
30
+ var iframes = iFrameResize( [{options}], [css selector] || [iframe] );
31
+ ```
32
+
33
+ or via **jQuery**. (See [notes](#browser-compatibility) below for using native version with IE8).
34
+
35
+ ```js
36
+ $('iframe').iFrameResize( [{options}] );
37
+ ```
38
+
39
+ The second file ([iframeResizer.contentWindow.min.js](https://raw.github.com/davidjbradshaw/iframe-resizer/master/js/iframeResizer.contentWindow.min.js)) is a **native** JavaScript file that needs placing in the page contained within your iFrame. <i>This file is designed to be a guest on someone else's system, so has no dependencies and won't do anything until it's activated by a message from the containing page</i>.
40
+
41
+ ### Typical setup
42
+
43
+ The normal configuration is to have the iFrame resize when the browser window changes size or the content of the iFrame changes. To set this up you need to configure one of the dimensions of the iFrame to a percentage and tell the library to only update the other dimension. Normally you would set the width to 100% and have the height scale to fit the content.
44
+
45
+ ```html
46
+ <style>iframe{width:100%}</style>
47
+ <iframe src="http://anotherdomain.com/iframe.html" scrolling="no"></iframe>
48
+ <script>iFrameResize({log:true})</script>
49
+ ```
50
+
51
+ Note that scrolling is set to 'no' in the iFrame tag, as older versions of IE don't allow this to be turned off in code and can just slightly add a bit of extra space to the bottom of the content that it doesn't report when it returns the height. If you have problems, check the [troubleshooting](#troubleshooting) section below.
52
+
53
+ ### Example
54
+ To see this working take a look at this [example](http://davidjbradshaw.com/iframe-resizer/example/) and watch the [console](https://developer.mozilla.org/en-US/docs/Tools/Web_Console).
55
+
56
+ ## Options
57
+
58
+ ### log
59
+
60
+ default: false
61
+ type: boolean
62
+
63
+ Setting the `log` option to true will make the scripts in both the host page and the iFrame output everything they do to the JavaScript console so you can see the communication between the two scripts.
64
+
65
+ ### autoResize
66
+
67
+ default: true
68
+ type: boolean
69
+
70
+ When enabled changes to the Window size or the DOM will cause the iFrame to resize to the new content size. Disable if using size method with custom dimensions.
71
+
72
+ <i>Note: When set to false the iFrame will still inititally size to the contained content, only additional resizing events are disabled.</i>
73
+
74
+ ### bodyBackground
75
+
76
+ default: null
77
+ type: string
78
+
79
+ Override the body background style in the iFrame.
80
+
81
+ ### bodyMargin
82
+
83
+ default: null
84
+ type: string || number
85
+
86
+ Override the default body margin style in the iFrame. A string can be any valid value for the CSS margin attribute, for example '8px 3em'. A number value is converted into px.
87
+
88
+ ### checkOrigin
89
+
90
+ default: true
91
+ type: boolean || array
92
+
93
+ When set to true, only allow incoming messages from the domain listed in the `src` property of the iFrame tag. If your iFrame navigates between different domains, ports or protocols; then you will need to provide an array of URLs or disable this option.
94
+
95
+ ### inPageLinks
96
+
97
+ default: false
98
+ type: boolean
99
+
100
+ When enabled in page linking inside the iFrame and from the iFrame to the parent page will be enabled.
101
+
102
+ ### interval
103
+
104
+ default: 32 (in ms)
105
+ type: number
106
+
107
+ In browsers that don't support [mutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver), such as IE10, the library falls back to using setInterval, to check for changes to the page size. The default value is equal to two frame refreshes at 60Hz, setting this to a higher value will make screen redraws noticeable to the user.
108
+
109
+ Setting this property to a negative number will force the interval check to run instead of [mutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver).
110
+
111
+ Set to zero to disable.
112
+
113
+ ### heightCalculationMethod
114
+
115
+ default: 'bodyOffset'
116
+ values: 'bodyOffset' | 'bodyScroll' | 'documentElementOffset' | 'documentElementScroll' |
117
+ 'max' | 'min' | 'grow' | 'lowestElement' | 'taggedElement'
118
+
119
+ By default the height of the iFrame is calculated by converting the margin of the `body` to <i>px</i> and then adding the top and bottom figures to the offsetHeight of the `body` tag.
120
+
121
+ In cases where CSS styles causes the content to flow outside the `body` you may need to change this setting to one of the following options. Each can give different values depending on how CSS is used in the page and each has varying side-effects. You will need to experiment to see which is best for any particular circumstance.
122
+
123
+ * **bodyScroll** uses `document.body.scrollHeight` <sup>*</sup>
124
+ * **documentElementOffset** uses `document.documentElement.offsetHeight`
125
+ * **documentElementScroll** uses `document.documentElement.scrollHeight` <sup>*</sup>
126
+ * **max** takes the largest value of the main four options <sup>*</sup>
127
+ * **min** takes the smallest value of the main four options <sup>*</sup>
128
+ * **grow** same as **max** but disables the double resize that is used to workout if the iFrame needs to shrink. This provides much better performance if your iFrame will only ever increase in size
129
+ * **lowestElement** Loops though every element in the the DOM and finds the lowest bottom point <sup>†</sup>
130
+ * **taggedElement** Finds the bottom of the lowest element with a `data-iframe-height` attribute
131
+
132
+ <i>Notes:</i>
133
+
134
+ <i>**If the default option doesn't work then the best solutions is to either to use** taggedElement, **or to use** lowestElement **in modern browsers and** max **in IE10 downwards.**</i>
135
+
136
+ ```js
137
+ var isOldIE = (navigator.userAgent.indexOf("MSIE") !== -1); // Detect IE10 and below
138
+
139
+ iFrameResize( {
140
+ heightCalculationMethod: isOldIE ? 'max' : 'lowestElement'
141
+ });
142
+ ```
143
+
144
+ Alternatively it is possible to add your own custom sizing method directly inside the iFrame, see [iFrame Page Options](https://github.com/davidjbradshaw/iframe-resizer#iframe-page-options) section below.
145
+
146
+ <sup> † </sup> <i>The **lowestElement** option is the most reliable way of determining the page height. However, it does have a performance impact in older versions of IE. In one screen refresh (16ms) Chrome can calculate the position of around 10,000 html nodes, whereas IE 8 can calculate approximately 50. The **taggedElement** option provides much greater performance by limiting the number of elements that need their position checked.</i>
147
+
148
+ <sup> * </sup><i>The **bodyScroll**, **documentElementScroll**, **max** and **min** options can cause screen flicker and will prevent the [interval](#interval) trigger downsizing the iFrame when the content shrinks. This is mainly an issue in IE 10 and below, where the [mutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver) event is not supported. To overcome this you need to manually trigger a page resize by calling the [parentIFrame.size()](#size-customheight-customwidth) method when you remove content from the page.</i>
149
+
150
+
151
+ ### maxHeight / maxWidth
152
+
153
+ default: infinity
154
+ type: integer
155
+
156
+ Set maximum height/width of iFrame.
157
+
158
+ ### minHeight / minWidth
159
+
160
+ default: 0
161
+ type: integer
162
+
163
+ Set minimum height/width of iFrame.
164
+
165
+ ### resizeFrom
166
+
167
+ default: 'parent'
168
+ values: 'parent', 'child'
169
+
170
+ Listen for resize events from the parent page, or the iFrame. Select the 'child' value if the iFrame can be resized independently of the browser window. <i>Selecting this value can cause issues with some height calculation methods on mobile devices</i>.
171
+
172
+ ### scrolling
173
+
174
+ default: false
175
+ type: boolean
176
+
177
+ Enable scroll bars in iFrame.
178
+
179
+ ### sizeHeight
180
+
181
+ default: true
182
+ type: boolean
183
+
184
+ Resize iFrame to content height.
185
+
186
+ ### sizeWidth
187
+
188
+ default: false
189
+ type: boolean
190
+
191
+ Resize iFrame to content width.
192
+
193
+
194
+ ### tolerance
195
+
196
+ default: 0
197
+ type: integer
198
+
199
+ Set the number of pixels the iFrame content size has to change by, before triggering a resize of the iFrame.
200
+
201
+ ### widthCalculationMethod
202
+
203
+ default: 'scroll'
204
+ values: 'bodyOffset' | 'bodyScroll' | 'documentElementOffset' | 'documentElementScroll' |
205
+ 'max' | 'min' | 'scroll' | 'rightMostElement' | 'taggedElement'
206
+
207
+ By default the width of the page is worked out by taking the greater of the **documentElement** and **body** scrollWidth values.
208
+
209
+ Some CSS techniques may require you to change this setting to one of the following options. Each can give different values depending on how CSS is used in the page and each has varying side-effects. You will need to experiment to see which is best for any particular circumstance.
210
+
211
+ * **bodyOffset** uses `document.body.offsetWidth`
212
+ * **bodyScroll** uses `document.body.scrollWidth` <sup>*</sup>
213
+ * **documentElementOffset** uses `document.documentElement.offsetWidth`
214
+ * **documentElementScroll** uses `document.documentElement.scrollWidth` <sup>*</sup>
215
+ * **scroll** takes the largest value of the two scroll options
216
+ * **max** takes the largest value of the main four options <sup>*</sup>
217
+ * **min** takes the smallest value of the main four options <sup>*</sup>
218
+ * **rightMostElement** Loops though every element in the the DOM and finds the right most point <sup>†</sup>
219
+ * **taggedElement** Finds the left most element with a `data-iframe-width` attribute
220
+
221
+ Alternatively it is possible to add your own custom sizing method directly inside the iFrame, see [iFrame Page Options](https://github.com/davidjbradshaw/iframe-resizer#iframe-page-options) section below.
222
+
223
+ <sup> † </sup> <i>The **rightMostElement** option is the most reliable way of determining the page width. However, it does have a performance impact in older versions of IE. In one screen refresh (16ms) Chrome can calculate the position of around 10,000 html nodes, whereas IE 8 can calculate approximately 50. The **taggedElement** option provides much greater performance by limiting the number of elements that need their position checked.</i>
224
+
225
+ <sup> * </sup><i>The **bodyScroll**, **documentElementScroll**, **max** and **min** options can cause screen flicker and will prevent the [interval](#interval) trigger downsizing the iFrame when the content shrinks. This is mainly an issue in IE 10 and below, where the [mutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver) event is not supported. To overcome this you need to manually trigger a page resize by calling the [parentIFrame.size()](#size-customheight-customwidth) method when you remove content from the page.</i>
226
+
227
+
228
+
229
+ ## Callback Methods
230
+
231
+ ### closedCallback
232
+
233
+ type: function (iframeID)
234
+
235
+ Called when iFrame is closed via `parentIFrame.close()` or `iframe.iframeResizer.close()` methods. See below for details.
236
+
237
+ ### initCallback
238
+
239
+ type: function (iframe)
240
+
241
+ Initial setup callback function.
242
+
243
+ ### messageCallback
244
+
245
+ type: function ({iframe,message})
246
+
247
+ Receive message posted from iFrame with the `parentIFrame.sendMessage()` method.
248
+
249
+ ### resizedCallback
250
+
251
+ type: function ({iframe,height,width,type})
252
+
253
+ Function called after iFrame resized. Passes in messageData object containing the **iFrame**, **height**, **width** and the **type** of event that triggered the iFrame to resize.
254
+
255
+ ### scrollCallback
256
+
257
+ type: function ({x,y})
258
+
259
+ Called before the page is repositioned after a request from the iFrame, due to either an in page link, or a direct request from either [parentIFrame.scrollTo()](#scrolltoxy) or [parentIFrame.scrollToOffset()](#scrolltooffsetxy). If this callback function returns false, it will stop the library from repositioning the page, so that you can implement your own animated page scrolling instead.
260
+
261
+
262
+
263
+ ## IFrame Page Options
264
+
265
+ The following options can be set from within the iFrame page by creating a `window.iFrameResizer` object before the JavaScript file is loaded into the page.
266
+
267
+ ```html
268
+ <script>
269
+ window.iFrameResizer = {
270
+ targetOrigin: 'http://mydomain.com'
271
+ }
272
+ </script>
273
+ <script src="js/iframeresizer.contentwindow.js"></script>
274
+ ```
275
+
276
+ ### targetOrigin
277
+
278
+ default: '*'
279
+ type: string
280
+
281
+ This option allows you to restrict the domain of the parent page, to prevent other sites mimicing your parent page.
282
+
283
+ ### messageCallback
284
+
285
+ type: function (message)
286
+
287
+ Receive message posted from the parent page with the `iframe.iFrameResizer.sendMessage()` method (See below for details).
288
+
289
+ ### readyCallback
290
+
291
+ type: function()
292
+
293
+ This function is called once iFrame-Resizer has been initialized after receiving a call from the parent page. If you need to call any of the parentIFrame methods (See below) during page load, then they should be called from this callback.
294
+
295
+ ### heightCalculationMethod / widthCalculationMethod
296
+
297
+ default: null
298
+ type: string | function() { return integer }
299
+
300
+ These options can be used to override the option set in the parent page (See above for details on available values). This can be useful when moving between pages in the iFrame that require different values for these options.
301
+
302
+ Altenatively you can pass a custom function that returns the size as an integer. This can be useful when none of the standard ways of working out the size are suitable. However, normally problems with sizing are due to CSS issues and this should be looked at first.
303
+
304
+ ## IFrame Page Methods
305
+
306
+ These methods are available in the iFrame via the `window.parentIFrame` object. These method should be contained by a test for the `window.parentIFrame` object, in case the page is not loaded inside an iFrame. For example:
307
+
308
+ ```js
309
+ if ('parentIFrame' in window) {
310
+ parentIFrame.close();
311
+ }
312
+ ```
313
+
314
+ ### autoResize([bool])
315
+
316
+ Turn autoResizing of the iFrame on and off. Returns bool of current state.
317
+
318
+ ### close()
319
+
320
+ Remove the iFrame from the parent page.
321
+
322
+ ### getId()
323
+
324
+ Returns the ID of the iFrame that the page is contained in.
325
+
326
+ ### getPageInfo(callback || false)
327
+
328
+ Ask the containing page for its positioning coordinates. You need to provide a callback which receives an object with the following properties:
329
+
330
+ * **iframeHeight** The height of the iframe in pixels
331
+ * **iframeWidth** The width of the iframe in pixels
332
+ * **clientHeight** The height of the viewport in pixels
333
+ * **clientWidth** The width of the viewport in pixels
334
+ * **offsetLeft** The number of pixels between the left edge of the containing page and the left edge of the iframe
335
+ * **offsetTop** The number of pixels between the top edge of the containing page and the top edge of the iframe
336
+ * **scrollLeft** The number of pixels between the left edge of the iframe and the left edge of the iframe viewport
337
+ * **scrollTop** The number of pixels between the top edge of the iframe and the top edge of the iframe viewport
338
+
339
+ Your callback function will be recalled when the parent page is scrolled or resized.
340
+
341
+ Pass `false` to disable the callback.
342
+
343
+ ### scrollTo(x,y)
344
+
345
+ Scroll the parent page to the coordinates x and y.
346
+
347
+ ### scrollToOffset(x,y)
348
+
349
+ Scroll the parent page to the coordinates x and y relative to the position of the iFrame.
350
+
351
+ ### sendMessage(message,[targetOrigin])
352
+
353
+ Send data to the containing page, `message` can be any data type that can be serialized into JSON. The `targetOrigin` option is used to restrict where the message is sent to; to stop an attacker mimicking your parent page. See the MDN documentation on [postMessage](https://developer.mozilla.org/en-US/docs/Web/API/Window.postMessage) for more details.
354
+
355
+ ### setHeightCalculationMethod(heightCalculationMethod)
356
+
357
+ Change the method use to workout the height of the iFrame.
358
+
359
+ ### size ([customHeight],[ customWidth])
360
+
361
+ Manually force iFrame to resize. This method optionally accepts two arguments: **customHeight** & **customWidth**. To use them you need first to disable the `autoResize` option to prevent auto resizing and enable the `sizeWidth` option if you wish to set the width.
362
+
363
+ ```js
364
+ iFrameResize({
365
+ autoResize: false,
366
+ sizeWidth: true
367
+ });
368
+ ```
369
+
370
+ Then you can call the `size` method with dimensions:
371
+
372
+ ```js
373
+ if ('parentIFrame' in window) {
374
+ parentIFrame.size(100); // Set height to 100px
375
+ }
376
+ ```
377
+
378
+
379
+
380
+ ##IFrame Object Methods
381
+
382
+ Once the iFrame has been initialized, an `iFrameResizer` object is bound to it. This has the following methods available.
383
+
384
+ ### close()
385
+
386
+ Remove the iFrame from the page.
387
+
388
+ ### moveToAnchor(anchor)
389
+
390
+ Move to anchor in iFrame.
391
+
392
+ ### resize()
393
+
394
+ Tell the iFrame to resize itself.
395
+
396
+ ### sendMessage(message,[targetOrigin])
397
+
398
+ Send data to the containing page, `message` can be any data type that can be serialized into JSON. The `targetOrigin` option is used to restrict where the message is sent to, in case your iFrame navigates away to another domain.
399
+
400
+
401
+ ## Troubleshooting
402
+
403
+ The first steps to investigate a problem is to make sure you are using the latest version and then enable the [log](#log) option, which outputs everything that happens to the [JavaScript Console](https://developers.google.com/chrome-developer-tools/docs/console#opening_the_console). This will enable you to see what both the iFrame and host page are up to and also see any JavaScript error messages.
404
+
405
+ Solutions for the most common problems are outlined in this section. If you need futher help, then please ask questions on [StackOverflow](http://stackoverflow.com/questions/tagged/iframe-resizer) with the `iframe-resizer` tag.
406
+
407
+ Bug reports and pull requests are welcome on the [issue tracker](https://github.com/davidjbradshaw/iframe-resizer/issues). Please read the [contributing guidelines](https://github.com/davidjbradshaw/iframe-resizer/blob/master/CONTRIBUTING.md) before openning a ticket, as this will ensure a faster resolution.
408
+
409
+ ### Multiple IFrames on one page
410
+ When the resizer does not work using multiple IFrames on one page, make sure that each frame has an unique id.
411
+
412
+ ### IFrame not sizing correctly
413
+ If a larger element of content is removed from the normal document flow, through the use of absolute positioning, it can prevent the browser working out the correct size of the page. In such cases you can change the [heightCalculationMethod](#heightcalculationmethod) to uses one of the other sizing methods.
414
+
415
+ ### IFrame not downsizing
416
+ The most likely cause of this problem is having set the height of an element to be 100% of the page somewhere in your CSS. This is normally on the `html` or `body` elements, but it could be on any element in the page. This can sometimes be got around by using the `taggedElement` height calculation method and added a `data-iframe-height` attribute to the element that you want to define the bottom position of the page. You may find it useful to use `position: relative` on this element to define a bottom margin or allow space for a floating footer.
417
+
418
+ Not having a valid [HTML document type](http://en.wikipedia.org/wiki/Document_type_declaration) in the iFrame can also sometimes prevent downsizing. At it's most simplest this can be the following.
419
+
420
+ ```html
421
+ <!DOCTYPE html>
422
+ ```
423
+
424
+ ### IFrame not resizing
425
+ The most common cause of this is not placing the [iframeResizer.contentWindow.min.js](https://raw.github.com/davidjbradshaw/iframe-resizer/master/js/iframeResizer.contentWindow.min.js) script inside the iFramed page. If the other page is on a domain outside your control and you can not add JavaScript to that page, then now is the time to give up all hope of ever getting the iFrame to size to the content. As it is impossible to work out the size of the contained page, without using JavaScript on both the parent and child pages.
426
+
427
+ ### IFrame not detecting CSS :hover events
428
+ If your page resizes via CSS `:hover` events, these won't be detected by default. It is however possible to create `mouseover` and `mouseout` event listeners on the elements that are resized via CSS and have these events call the [parentIFrame.size()](##parentiframesize-customheight-customwidth) method. With jQuery this can be done as follows
429
+
430
+ ```js
431
+ function resize(){
432
+ if ('parentIFrame' in window) {
433
+ // Fix race condition in FireFox with setTimeout
434
+ setTimeout(parentIFrame.size.bind(parentIFrame),0);
435
+ }
436
+ }
437
+
438
+ $(*Element with hover style*).hover(resize);
439
+ ```
440
+
441
+ ### IFrame not detecting textarea resizes
442
+
443
+ Both FireFox and the WebKit based browsers allow the user to resize `textarea` input boxes. Unfortunately the WebKit browsers don't trigger the mutation event when this happens. This can be worked around to some extent with the following code.
444
+
445
+ ```js
446
+ function store(){
447
+ this.x = this.offsetWidth;
448
+ this.y = this.offsetHeight;
449
+ }
450
+
451
+ $('textarea').each(store).on('mouseover mouseout',function(){
452
+ if (this.offsetWidth !== this.x || this.offsetHeight !== this.y){
453
+ store.call(this);
454
+ if ('parentIFrame' in window){
455
+ parentIFrame.size();
456
+ }
457
+ }
458
+ });
459
+ ```
460
+
461
+ ### IFrame flickers
462
+
463
+ Some of the alternate [height calculation methods](#heightcalculationmethod), such as **max** can cause the iFrame to flicker. This is due to the fact that to check for downsizing, the iFrame first has to be downsized before the new height can be worked out. This effect can be reduced by setting a [minSize](#minheight--minwidth) value, so that the iFrame is not reset to zero height before regrowing.
464
+
465
+ In modern browsers, if the default [height calculation method](#heightcalculationmethod) does not work, then it is normally best to use **lowestElement**, which is flicker free, and then provide a fallback to **max** in IE10 downwards.
466
+
467
+ ```js
468
+ var isOldIE = (navigator.userAgent.indexOf("MSIE") !== -1); // Detect IE10 and below
469
+
470
+ iFrameResize({
471
+ heightCalculationMethod: isOldIE ? 'max' : 'lowestElement',
472
+ minSize:100
473
+ });
474
+ ```
475
+ <i>Please see the notes section under [heightCalculationMethod](#heightcalculationmethod) to understand the limitations of the different options.</i>
476
+
477
+ ### ParentIFrame not found errors
478
+ The `parentIFrame` object is created once the iFrame has been initially resized. If you wish to use it during page load you will need call it from the readyCallback.
479
+
480
+ ```html
481
+ <script>
482
+ window.iFrameResizer = {
483
+ readyCallback: function(){
484
+ var myId = window.parentIFrame.getId();
485
+ console.log('The ID of the iFrame in the parent page is: '+myId);
486
+ }
487
+ }
488
+ </script>
489
+ <script src="js/iframeresizer.contentwindow.js"></script>
490
+ ```
491
+
492
+ ### PDF and OpenDocument files
493
+ It is not possible to add the required JavaScript to PDF and ODF files. However, you can get around this limitation by using [ViewerJS](http://viewerjs.org/) to render these files inside a HTML page, that also contains the iFrame JavaScript file ([iframeResizer.contentWindow.min.js](https://raw.github.com/davidjbradshaw/iframe-resizer/master/js/iframeResizer.contentWindow.min.js)).
494
+
495
+ ### Unexpected message received error
496
+ By default the origin of incoming messages is checked against the `src` attribute of the iFrame. If they don't match an error is thrown. This behaviour can be disabled by setting the [checkOrigin](#checkorigin) option to **false**.
497
+
498
+ ### Width not resizing
499
+ By default only changes in height are detected, if you want to calculate the width you need to set the `sizeWidth` opion to true and the `sizeHeight` option to false.
500
+
501
+
502
+ ## Browser compatibility
503
+ ### jQuery version
504
+
505
+ Basic support works with all browsers which support [window.postMessage](http://caniuse.com/#feat=x-doc-messaging) (IE8+). Some advanced features require the native version polyfil to work in IE8.
506
+
507
+ ### Native version
508
+
509
+ Additionally requires support for [Array.prototype.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach) and [Function.prototype.bind](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_objects/Function/bind) (IE9+), plus [document.querySelectorAll](https://developer.mozilla.org/en-US/docs/Web/API/Document.querySelectorAll) (IE8 Standards Mode). For **IE8** force [Standards Mode](http://en.wikipedia.org/wiki/Internet_Explorer_8#Standards_mode) and include the [IE8 PolyFils](https://github.com/davidjbradshaw/iframe-resizer/blob/master/src/ie8.polyfils.js) on the host page.
510
+
511
+ ```html
512
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
513
+ <!--[if lte IE 8]>
514
+ <script type="text/javascript" src="js/ie8.polyfils.min.js"></script>
515
+ <![endif]-->
516
+ ```
517
+
518
+
519
+ ## Upgrading to version 3
520
+
521
+ The requirements for IE8 support in version 3 have changed from version 2. If you still require IE8 support than you will need to ensure you include the new ie8.polyfil.js file, as outlined above.
522
+
523
+ The parentIFrame methods object in the iFrame is now always available and the `enablePublicMethods` option has been removed. The `enableInPageLinks` option has been rename to `inPageLinks`.
524
+
525
+
526
+ ## Version History
527
+
528
+ * v3.5.5 [#373](https://github.com/davidjbradshaw/iframe-resizer/issues/373) Add option for custom size calculation methods in iFrame. [#374](https://github.com/davidjbradshaw/iframe-resizer/issues/374) Fix bug with in page links called from parent page.
529
+ * v3.5.4 [#362](https://github.com/davidjbradshaw/iframe-resizer/issues/362) Handle jQuery being loaded in odd ways. [#297](ttps://github.com/davidjbradshaw/iframe-resizer/issues/297) Ensure document ready before resizing
530
+ * v3.5.3 [#283](https://github.com/davidjbradshaw/iframe-resizer/issues/283) Added *readystatechange* event listener.
531
+ * v3.5.2 [#314](https://github.com/davidjbradshaw/iframe-resizer/pull/314) Add iframeHeight and iframeWidth properties to pageInfo [[Pierre Olivier](https://github.com/pomartel)]. [#303](https://github.com/davidjbradshaw/iframe-resizer/issues/303) Fix issue with IE8 polyFils.
532
+ * v3.5.1 [#286](https://github.com/davidjbradshaw/iframe-resizer/issues/286) Fixed *taggedElement / lowestElement / rightMostElement* to calculate correct margin [[Dan Ballance](danballance)].
533
+ * v3.5.0 Recall getPageInfo callback when parent page position changes. Added *Array.prototype.forEach* to IE8 polyfils.
534
+ * v3.4.2 Only teardown events on close if currently enabled.
535
+ * v3.4.1 [#271](https://github.com/davidjbradshaw/iframe-resizer/issues/271) Fix bower.json to point to *js* folder, rather then *src* [[Yachi](https://github.com/yachi)].
536
+ * v3.4.0 [#262](https://github.com/davidjbradshaw/iframe-resizer/issues/262) Add *getPageInfo* method to *parentIFrame* [[Pierre Olivier](https://github.com/pomartel)]. [#263](https://github.com/davidjbradshaw/iframe-resizer/issues/263) Change *leftMostElement* to rightMostElement [[Luiz Panariello](https://github.com/LuizPanariello)]. [#265](https://github.com/davidjbradshaw/iframe-resizer/issues/265) Fix issue when no options being passed and added test for this.
537
+ * v3.3.1 Point index.js to the JS folder, instead of the src folder. Added touch event listeners. *AutoResize* method now returns current state.
538
+ * v3.3.0 [#97](https://github.com/davidjbradshaw/iframe-resizer/issues/97) Add *autoResize* method to *parentIFrame*. Fix bug when *setHeightCalculationMethod* is called with invalid value. Add interval timer to event teardown. Log targetOrigin*. [#253](https://github.com/davidjbradshaw/iframe-resizer/issues/253) Work around bug with MooTools interfering with system objects.
539
+ * v3.2.0 Added calculation of margin to *LowestElement*, *LeftMostElement* and *taggedElement* calculation modes. Check callback function is a function before calling it. [#246](https://github.com/davidjbradshaw/iframe-resizer/issues/246) Fixed issue when *scrollCallback* changes the page position. [#247](https://github.com/davidjbradshaw/iframe-resizer/issues/247) Fix rounding issue when page is zoomed in Chrome [[thenewguy](https://github.com/thenewguy)].
540
+ * v3.1.1 Added *readyCallback* to iFrame. Create *iFrameResizer* object on iFrame during setup, rather than waiting for init message to be returned from iFrame. Add ref to iFrame in host page log messages. [#245](https://github.com/davidjbradshaw/iframe-resizer/issues/245) Fix issue with iFrame not correctly resizing when multiple images are injected into the page [[mdgbayly](https://github.com/mdgbayly)]. [#246](https://github.com/davidjbradshaw/iframe-resizer/issues/246) Fix issue with including ':' in messages passed to iFrames.
541
+ * v3.1.0 [#101](https://github.com/davidjbradshaw/iframe-resizer/issues/101) Support async loading of iFrame script. [#239](https://github.com/davidjbradshaw/iframe-resizer/issues/239) Throttle size checking to once per screen refresh (16ms). Fixed issue with hidden iFrames in FireFox. Improved handling of parent page events. [#236](https://github.com/davidjbradshaw/iframe-resizer/issues/236) Cope with iFrames that don't have a *src* value. [#242](https://github.com/davidjbradshaw/iframe-resizer/issues/242) Fix issue where iFrame is removed and then put back with same ID [[Alban Mouton](https://github.com/albanm)].
542
+ * v3.0.0 Added *taggedElement* size calculation method. [#199](https://github.com/davidjbradshaw/iframe-resizer/issues/199) Added in page options to iFrame. [#70](https://github.com/davidjbradshaw/iframe-resizer/issues/70) Added width calculation method options. Added methods to bound iFrames to comunicate from parent to iFrame. Ignore calls to setup an already bound iFrame. Improved event handling. Refactored MutationObserver functions. Moved IE8 polyfil from docs to own JS file and added *Funtion.prototype.bind()*. Added detection for tab focus. Fixed bug with nested inPageLinks. Public methods in iFrame now always enabled and option removed. Renamed enableInPageLinks to inPageLinks. Added double iFrame example.
543
+ * v2.8.10 Fixed bug with resizeFrom option not having default value in iFrame, if called from old version in parent page.
544
+ * v2.8.9 [#220](https://github.com/davidjbradshaw/iframe-resizer/issues/220) Switched from using *deviceorientation* to *orientationchange* event listner [[Brandon Kobel](https://github.com/kobelb)].
545
+ * v2.8.8 [#213](https://github.com/davidjbradshaw/iframe-resizer/issues/213) Ensure initCallback fires when iFrame not sized during initialisation. Check autoResize option before resizing from parent. Lower message about resize before initialisation from 'warn' to 'log'. Updated hover example.
546
+ * v2.8.7 [#205](https://github.com/davidjbradshaw/iframe-resizer/issues/205) Fix race condition when page resized during page init [[Ian Caunce](https://github.com/IanCaunce)]. [#203](https://github.com/davidjbradshaw/iframe-resizer/issues/203) Added option for *checkOrigin* to have list of allowed domains for the iFrame [[Andrej Golcov](https://github.com/andrej2k)]. [#202](https://github.com/davidjbradshaw/iframe-resizer/issues/202) Handle script being loaded more than once [[Nickolay Ribal](https://github.com/elektronik2k5)].
547
+ [#167](https://github.com/davidjbradshaw/iframe-resizer/issues/167) Added WebPack support [[Stephan Salat](https://github.com/ssalat)].
548
+ * v2.8.6 [#163](https://github.com/davidjbradshaw/iframe-resizer/issues/163) Moved window resize event detection from iFrame to parent page. [#160](https://github.com/davidjbradshaw/iframe-resizer/issues/160) Warn, rather than error, if iFrame has been unexpectantly removed from page. The *parentIFrame.close()* method nolonger calls *resizedCallback()*.
549
+ * v2.8.5 [#173](https://github.com/davidjbradshaw/iframe-resizer/issues/173) Scope settings to iFrame. [#171](https://github.com/davidjbradshaw/iframe-resizer/issues/171) Fixed *parentIFrame.close()* to work with 0 height iframes [Both [Reed Dadoune](https://github.com/ReedD)].
550
+ * v2.8.4 Added switch for inPageLinking support.
551
+ * v2.8.3 Throw error if passed a non-DOM object.
552
+ * v2.8.2 [#145](https://github.com/davidjbradshaw/iframe-resizer/issues/145) Fixed in page links, to work with HTML IDs that are not valid CSS IDs [[Erin Millard](https://github.com/ezzatron)]. Moved map files from src to js folder. Added to NPM.
553
+ * v2.8.1 [#138](https://github.com/davidjbradshaw/iframe-resizer/issues/138) Added option to pass in iFrame object, instead of selector.
554
+ * v2.8.0 [#68](https://github.com/davidjbradshaw/iframe-resizer/issues/68) Added support for in page links and *scrollCallback()* function. [#140](https://github.com/davidjbradshaw/iframe-resizer/issues/140) Added listener for *transitionend* event [[Mat Brown](https://github.com/outoftime)]. Added listeners for animation events. Added listener for *deviceorientation* event. Improved logging for nested iFrames.
555
+ * v2.7.1 [#131](https://github.com/davidjbradshaw/iframe-resizer/issues/131) Fix code that works out position of iFrame on host page.
556
+ * v2.7.0 [#129](https://github.com/davidjbradshaw/iframe-resizer/issues/129) Parse data passed to *parentIFrame.sendMessage()* into JSON to allow complex data types to be sent to *messageCallback()*.
557
+ * v2.6.5 [#107](https://github.com/davidjbradshaw/iframe-resizer/issues/107) Added Node support for use with Browserify.
558
+ * v2.6.4 [#115](https://github.com/davidjbradshaw/iframe-resizer/issues/115) Added *parentIFrame.scrollToOffset()* method.
559
+ * v2.6.3 [#115](https://github.com/davidjbradshaw/iframe-resizer/issues/115) Fixed issue with the range check sometimes causing non-resizing messages to be rejected.
560
+ * v2.6.2 [#104](https://github.com/davidjbradshaw/iframe-resizer/issues/104) Fixed issue with jQuery.noConflict [[Dmitry Mukhutdinov](https://github.com/flyingleafe)].
561
+ * v2.6.1 [#91](https://github.com/davidjbradshaw/iframe-resizer/issues/91) Fixed issue with jQuery version requiring empty object if no options are being set.
562
+ * v2.6.0 Added *parentIFrame.scrollTo()* method. Added *Tolerance* option. [#85](https://github.com/davidjbradshaw/iframe-resizer/issues/85) Update troubleshooting guide [[Kevin Sproles](https://github.com/kevinsproles)].
563
+ * v2.5.2 [#67](https://github.com/davidjbradshaw/iframe-resizer/issues/67) Allow lowercase `<iframe>` tags for XHTML complience [[SlimerDude](https://github.com/SlimerDude)]. [#69](https://github.com/davidjbradshaw/iframe-resizer/issues/69) Fix watch task typo in gruntfile.js [[Matthew Hupman](https://github.com/mhupman)]. Remove trailing comma in heightCalcMethods array [#76](https://github.com/davidjbradshaw/iframe-resizer/issues/76) [[Fabio Scala](https://github.com/fabioscala)].
564
+ * v2.5.1 [#58](https://github.com/davidjbradshaw/iframe-resizer/issues/58) Fixed endless loop and margin issues with an unnested mid-tier iframe. [#59](https://github.com/davidjbradshaw/iframe-resizer/issues/59) Fixed main property of [Bower](http://bower.io/) config file.
565
+ * v2.5.0 Added *minHeight*, *maxHeight*, *minWidth* and *maxWidth* options. Added *initCallback* and *closedCallback* functions (Close event calling *resizedCallback* is deprecated). Added **grow** and **lowestElement** *heightCalculationMethods*. Added AMD support. [#52](https://github.com/davidjbradshaw/iframe-resizer/issues/52) Added *sendMessage* example. [#54](https://github.com/davidjbradshaw/iframe-resizer/issues/54) Work around IE8's borked JS execution stack. [#55](https://github.com/davidjbradshaw/iframe-resizer/issues/55) Check datatype of passed in options.
566
+ * v2.4.8 Fix issue when message passed to messageCallback contains a colon.
567
+ * v2.4.7 [#49](https://github.com/davidjbradshaw/iframe-resizer/issues/49) Deconflict requestAnimationFrame.
568
+ * v2.4.6 [#46](https://github.com/davidjbradshaw/iframe-resizer/issues/46) Fix iFrame event listener in IE8.
569
+ * v2.4.5 [#41](https://github.com/davidjbradshaw/iframe-resizer/issues/41) Prevent error in FireFox when body is hidden by CSS [[Scott Otis](/Scotis)].
570
+ * v2.4.4 Enable nested iFrames ([#31](https://github.com/davidjbradshaw/iframe-resizer/issues/31) Filter incoming iFrame message in host-page script. [#33](https://github.com/davidjbradshaw/iframe-resizer/issues/33) Squash unexpected message warning when using nested iFrames. Improved logging for nested iFrames). [#38](https://github.com/davidjbradshaw/iframe-resizer/issues/38) Detect late image loads that cause a resize due to async image loading in WebKit [[Yassin](/ynh)]. Fixed :Hover example in FireFox. Increased trigger timeout lock to 64ms.
571
+ * v2.4.3 Simplified handling of double fired events. Fixed test coverage.
572
+ * v2.4.2 Fix missing 'px' unit when resetting height.
573
+ * v2.4.1 Fix screen flicker issue with scroll height calculation methods in v2.4.0.
574
+ * v2.4.0 Improved handling of alternate sizing methods, so that they will now shrink on all trigger events, except *Interval*. Prevent error when incoming message to iFrame is an object.
575
+ * v2.3.2 Fix backwards compatibility issue between V2 iFrame and V1 host-page scripts.
576
+ * v2.3.1 Added setHeightCalculationMethod() method in iFrame. Added *min* option to the height calculation methods. Invalid value for *heightCalculationMethod* is now a warning rather than an error and now falls back to the default value.
577
+ * v2.3.0 Added extra *heightCalculationMethod* options. Inject clearFix into 'body' to work around CSS floats preventing the height being correctly calculated. Added meaningful error message for non-valid values in *heightCalculationMethod*. Stop **click** events firing for 50ms after **size** events. Fixed hover example in old IE.
578
+ * v2.2.3 [#26](https://github.com/davidjbradshaw/iframe-resizer/issues/26) Locally scope jQuery to $, so there is no dependancy on it being defined globally.
579
+ * v2.2.2 [#25](https://github.com/davidjbradshaw/iframe-resizer/issues/25) Added click listener to Window, to detect CSS checkbox resize events.
580
+ * v2.2.1 [#24](https://github.com/davidjbradshaw/iframe-resizer/issues/24) Prevent error when incoming message to host page is an object [[Torjus Eidet](https://github.com/torjue)].
581
+ * v2.2.0 Added targetOrigin option to sendMessage function. Added bodyBackground option. Expanded troubleshooting section.
582
+ * v2.1.1 [#16](https://github.com/davidjbradshaw/iframe-resizer/issues/16) Option to change the height calculation method in the iFrame from offsetHeight to scrollHeight. Troubleshooting section added to docs.
583
+ * v2.1.0 Added sendMessage() and getId() to window.parentIFrame. Changed width calculation to use scrollWidth. Removed deprecated object name in iFrame.
584
+ * v2.0.0 Added native JS public function, renamed script filename to reflect that jQuery is now optional. Renamed *do(Heigh/Width)* to *size(Height/Width)*, renamed *contentWindowBodyMargin* to *bodyMargin* and renamed *callback* *resizedCallback*. Improved logging messages. Stop *resize* event firing for 50ms after *interval* event. Added multiple page example. Workout unsized margins inside the iFrame. The *bodyMargin* property now accepts any valid value for a CSS margin. Check message origin is iFrame. Removed deprecated methods.
585
+ * v1.4.4 Fixed *bodyMargin* bug.
586
+ * v1.4.3 CodeCoverage fixes. Documentation improvements.
587
+ * v1.4.2 Fixed size(250) example in IE8.
588
+ * v1.4.1 Setting `interval` to a negative number now forces the interval test to run instead of [MutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver).
589
+ * v1.4.0 [#12](https://github.com/davidjbradshaw/iframe-resizer/issues/12) Option to enable scrolling in iFrame, off by default. [#13](https://github.com/davidjbradshaw/iframe-resizer/issues/13) Bower dependancies updated.
590
+ * v1.3.7 Stop *resize* event firing for 50ms after *size* event. Added size(250) to example.
591
+ * v1.3.6 [#11](https://github.com/davidjbradshaw/iframe-resizer/issues/11) Updated jQuery to v1.11.0 in example due to IE11 having issues with jQuery v1.10.1.
592
+ * v1.3.5 Documentation improvements. Added Grunt-Bump to build script.
593
+ * v1.3.0 IFrame code now uses default values if called with an old version of the host page script. Improved function naming. Old names have been deprecated and removed from docs.
594
+ * v1.2.5 Fix publish to [plugins.jquery.com](https://plugins.jquery.com).
595
+ * v1.2.0 Added autoResize option, added height/width values to iFrame public size function, set HTML tag height to auto, improved documentation [All [Jure Mav](https://github.com/jmav)]. Plus setInterval now only runs in browsers that don't support [MutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver) and is on by default, sourceMaps added and close() method introduced to parentIFrame object in iFrame.
596
+ * v1.1.1 Added event type to messageData object.
597
+ * v1.1.0 Added DOM [MutationObserver](https://developer.mozilla.org/en/docs/Web/API/MutationObserver) trigger to better detect content changes in iFrame, [#7](https://github.com/davidjbradshaw/iframe-resizer/issues/7) Set height of iFrame body element to auto to prevent resizing loop, if it's set to a percentage.
598
+ * v1.0.3 [#6](https://github.com/davidjbradshaw/iframe-resizer/issues/6) Force incoming messages to string. Migrated to Grunt 4.x. Published to Bower.
599
+ * v1.0.2 [#2](https://github.com/davidjbradshaw/iframe-resizer/issues/2) mime-type changed for IE8-10.
600
+ * v1.0.0 Initial pubic release.
601
+
602
+
603
+ ## License
604
+ Copyright &copy; 2013-15 [David J. Bradshaw](https://github.com/davidjbradshaw).
605
+ Licensed under the [MIT License](LICENSE).
606
+
607
+ [![NPM](https://nodei.co/npm/iframe-resizer.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/iframe-resizer/)
608
+ [![NPM](https://nodei.co/npm-dl/iframe-resizer.png?months=3&height=3)](https://nodei.co/npm/iframe-resizer/)