{jumi [choby/ceneprobnih.php ]} // Get height of document function getDocHeight(doc) { doc = doc || document; // from http://stackoverflow.com/questions/1145850/get-height-of-entire-document-with-javascript var body = doc.body, html = doc.documentElement; // var height = 0; var height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ); console.log(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight) return height; } // send docHeight onload function sendDocHeightMsg(e) { console.log(e) var ht = getDocHeight(); console.log(ht) parent.postMessage( JSON.stringify( {'docHeight': ht} ), '*' ); } // assign onload handler if ( window.addEventListener ) { window.addEventListener('load', sendDocHeightMsg, false); } else if ( window.attachEvent ) { // ie8 window.attachEvent('onload', sendDocHeightMsg); } var vrInputs = document.getElementsByTagName("input"); var vrSelects = document.getElementsByTagName("select"); for(i=0; i<vrInputs.length; i++){ vrInputs[i].addEventListener("click", function(){ setTimeout(sendNewHeightMsg, 0); }, false ) vrInputs[i].addEventListener("input", function(){ setTimeout(sendNewHeightMsg, 0); }, false ) } for(i=0; i<vrSelects.length; i++){ vrSelects[i].addEventListener("click", function(){ setTimeout(sendNewHeightMsg, 0); }, false ) vrSelects[i].addEventListener("input", function(){ setTimeout(sendNewHeightMsg, 0); }, false ) } function sendNewHeightMsg() { console.log("send"); var doc = document; var body = doc.body, html = doc.documentElement; var ht = Math.max(body.offsetHeight, html.offsetHeight ); parent.postMessage( JSON.stringify( {'docHeight': ht} ), '*' ); } window.addEventListener('resize', sendNewHeightMsg);