Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Overflow property, how to check when active?

0 views
Skip to first unread message

Robert van Gilst

unread,
May 2, 2003, 5:24:40 AM5/2/03
to
Hi,

When I use the overflow property on a div to set that it
should display scrollbars when the contents will come out
of the clipping area, I would like to check whether this
happens or not.

I want to make the same functionallity that is in the
MSDN library help. To be able to expand the div when
there is scrolling, but I only want to give the user the
option when there actually is overflow.

Sombody knows how to check this?

Thanks,

Robert

José Jeria

unread,
May 2, 2003, 9:19:24 AM5/2/03
to
check the elements height

var obj = document.getElementById("yourElement");

obj.style.overflow = (obj.offsetHeight > 300) "auto":"";

/J

Robert van Gilst

unread,
May 5, 2003, 2:59:03 AM5/5/03
to
Thanks José,

Not excactly what I had in mind, but it works as intended.

What I was looking for is a "flag" that shows whether the
overflow was activated or not. Using your version, I will
check whether height is greater than the specified height
and than set the overflow property. But this also works,
so what the heck.

Robert

>.
>

0 new messages