Click to See Complete Forum and Search --> : Detecting scrollbars on iFrames


croupier
01-28-2003, 04:18 AM
I have an iFrame with the default scrolling=auto set.

On some pages I point the iFrame to it will have scrollbars and on others it will not - this is how I want the iFrame to function.

What I want to do is detect whether the iFrame has scrollbars or not - is this possible?

gil davis
01-28-2003, 05:45 AM
If the iframe's scrollHeight is greater than the iframe's clientHeight, then there will be vertical scrollbars. Similarly, if the iframe's scrollWidth is greater than the iframe's clientWidth, then there will be horizontal scrollbars.

This link may help you:

http://msdn.microsoft.com/workshop/Author/om/measuring.asp

croupier
01-28-2003, 05:57 AM
Thanks for your help.

I worked out another way of doing what I wanted but just realised that Microsoft have recently plugged the security hole I was using (I wasn't doing anything evil - just trying to detect evil software on the visitors comp)