S
Shawn B.
Greetings,
I have an IFrame with overflow: auto set. I would like to, using
Javascript, discover whether scrollbars are rendered. In otherwords, I'd
like to know whether there is an overflow or not so I can make a decision
based on that test. I'm at a loss as to figuring this one out. Usually I
can figure anything out in Javascript but this eludes me.
I've tried
if (window.myIFrame.style.overflowY > 0) but overflowY is always empty.
I've tried
window.myIFrame.document.body.style.overflowY but for some reason it is
returning the height of the document containing the IFrame. In otherwords,
the main page is 795 pixels height, but the IFrame is 345 height. With I
use this property, it returns 688 instead of the difference of (375 and 345
which is 30 pixels).
The reason I care is because if there is a scrollbar for the overflow, I
will not render a border on the right but if there is no scrollbar I will
render a border on the right of the IFrame (the div containing the IFrame).
Thanks,
Shawn
I have an IFrame with overflow: auto set. I would like to, using
Javascript, discover whether scrollbars are rendered. In otherwords, I'd
like to know whether there is an overflow or not so I can make a decision
based on that test. I'm at a loss as to figuring this one out. Usually I
can figure anything out in Javascript but this eludes me.
I've tried
if (window.myIFrame.style.overflowY > 0) but overflowY is always empty.
I've tried
window.myIFrame.document.body.style.overflowY but for some reason it is
returning the height of the document containing the IFrame. In otherwords,
the main page is 795 pixels height, but the IFrame is 345 height. With I
use this property, it returns 688 instead of the difference of (375 and 345
which is 30 pixels).
The reason I care is because if there is a scrollbar for the overflow, I
will not render a border on the right but if there is no scrollbar I will
render a border on the right of the IFrame (the div containing the IFrame).
Thanks,
Shawn