Last active
July 5, 2016 16:49
-
-
Save benweiser/7d23e418a93b9097aa7d34d05f3ee92a to your computer and use it in GitHub Desktop.
Code for child page to post scrollHeight data to parent window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function(){window.onload=function(){function n(){window.parent.postMessage(document.documentElement.scrollHeight,"*")}var o=function(t,i){setTimeout(function(){n(),i&&o(t+100,--i)},t)};window.onload=o(500,10),window.onresize=function(){n()},window.addEventListener?window.addEventListener("click",n,!1):window.attachEvent("onclick",n)}}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment