jquery - Setting dimensions of an iframe AFTER content has loaded -


I am using an iframe to display content. Iframe loads and fire occurs to determine the height of the iframe after the incident, because it is unknown how long this time will be. Unfortunately it does not always work. I believe because the load event sets fire before content is loaded in iframe. Is there a way in jQuery to make this work properly? (Code) {$ (iframeSelector) .load (function () {$ (iframeSelector). Rituals ('98% '); var height = parseInt Function update iframeSelector ($ (IframeSelector) .contents (). ('Body'). Attr ('scrollHeight'); $ (iframeSelector). Height (height + "px");}); } Catch (mistake) {warning (mistake); Assuming that you are loading an HTML page inside the iframe, why not? Just add jQuery $ (document). If () function is on the page inside the iFrame, and does it update the height using a representative in the pants window?

For example, in iframe:

  $ (document) .ready (function () {var theHight = $ (window) .it (); window.parent .setiFrameHeight (theHeight);})    

Comments