Keep same and cross domain iFrames sized to their content.
Full Changelog: https://github.com/davidjbradshaw/iframe-resizer/compare/v5.0.1...v5.0.2
For the most part version 5 will be a drop in replacement. The following guide explains how the API has been simplified in the new version.
getParentProperties()
function that returns the following information from the parent page:
offset
option to adjust values returned from iframe
direction
optionpostMessageTarget
option to better support GAS iframespostMessage()
auto
ResizeObserver
API, by adding it to all non-static page elements. This provides improved detection of CSS :hover
, CSS Animation, <textarea/>
user resizing events and remove the need for user interaction event listeners.
heightCalculationMethod
/widthCalculationMethod
in favour of auto calculation mode detectiondata-iframe-height
/ date-iframe-width
for data-iframe-size
sizeHeight
and sizeWidth
in favour of new direction
optiongetPageInfo()
in favour of getParentProperties()
which returns more reliable and useful dataonInit()
-> onReady()
, and added deprecation warningsize()
-> resize()
in iframe, and added deprecation warning@iframe-resizer/jquery
MutationObserver
to now just look for added nodes in the document tree and ensure that new non-static elements are covered by ResizeObserver
minHeight
, maxHeight
, minWidth
and maxHeight
options, as modern CSS can now deal with this for us.mouse
, touch
and resize
event listeners, as not required alongside ResizeObserver
lowestElement
to exclude non-visible elements (head
, meta
, base
, title
, script
, link
, style
, map
, area
, option
, optgroup
, template
, track
, wbr
, nobr
) and then check remaining elements using element.checkVisibility()
getPageInfo()
to update when the size of the iframe changesgetPageInfo()
updates after leaving page in iframe that requested themauto !important
, incorrectly setting these values is the number one cause of problems effecting the page resizing