Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // iframe
- <script type="text/javascript">
- $('.tooltip').remove();
- (function() {
- var $win = $(window),
- $doc = $(document);
- function sendContentHeight() {
- if (window.parent && window.parent.postMessage) {
- window.parent.postMessage(JSON.stringify({ type: 'elasticframe', height: $doc.height() }), '*');
- }
- }
- $win.load(sendContentHeight);
- $doc.load(sendContentHeight);
- $doc.ready(sendContentHeight);
- $win.resize(sendContentHeight);
- }());
- </script>
- // outside
- <script>
- (function() {
- function setIframeHeight(ev) {
- var data;
- try {
- data = JSON.parse(ev.data);
- } catch(e) {}
- if (typeof data === 'object' && data.type === 'elasticframe' && typeof parseInt(data.height) === 'number') {
- document.getElementById('bild-channelizer').style.height = parseInt(data.height || 1800) + 'px';
- }
- }
- function resetIframeHeight() {
- document.getElementById('bild-channelizer').style.height = 'auto';
- }
- if (window.addEventListener) {
- window.addEventListener('orientationchange', resetIframeHeight);
- window.addEventListener('message', setIframeHeight);
- } else {
- window.attachEvent('onorientationchange', resetIframeHeight);
- window.attachEvent('onmessage', setIframeHeight);
- }
- }());
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement