Skip to content

Commit

Permalink
Making it more robust for all browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Aug 11, 2016
1 parent 87ac6ae commit 4c213a3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
24 changes: 14 additions & 10 deletions media/com_wrapper/js/iframe-height.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
function iFrameHeight()
{
var h = 0;
if (!document.all)
{
h = document.getElementById('blockrandom').contentWindow.document.body.scrollHeight;
document.getElementById('blockrandom').style.height = parseInt(h) + 60 + 'px';
} else if (document.all)
{
h = document.frames('blockrandom').document.body.scrollHeight;
document.all.blockrandom.style.height = parseInt(h) + 20 + 'px';
}
var height = 0;
var iframe = document.getElementById('blockrandom');
var doc = 'contentDocument' in iframe ? iframe.contentDocument : iframe.contentWindow.document;

if (!document.all)
{
height = doc.body.scrollHeight;
iframe.style.height = parseInt(height) + 60 + 'px';
}
else if (document.all)
{
height = doc.body.scrollHeight;
document.all.blockrandom.style.height = parseInt(height) + 20 + 'px';
}
}
2 changes: 1 addition & 1 deletion media/com_wrapper/js/iframe-height.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4c213a3

Please sign in to comment.