By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,774 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,774 IT Pros & Developers. It's quick & easy.

Determine if scrollbar is visible?

P: n/a
Is there anyway to determine if a DIV with its overflow style set to
auto has the scrollbars visible? I have a dynamically built table inside
my DIV. If the table is over a certain height and the scrollbars appear,
I want to shrink the width of my table. If the table's height doesn't
exceed the div's height, I want the table to be the same width as the
div. Any ideas?

*** Sent via Developersdex http://www.developersdex.com ***
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Ivo
"Turgeson" wrote
Is there anyway to determine if a DIV with its overflow style set to
auto has the scrollbars visible? I have a dynamically built table inside
my DIV. If the table is over a certain height and the scrollbars appear,
I want to shrink the width of my table. If the table's height doesn't
exceed the div's height, I want the table to be the same width as the
div. Any ideas?


What is wrong with
<table style="width:100%;">

? I believe generally such table behaves quite like you describe.
hth
--
Ivo
Jul 23 '05 #2

P: n/a
I was using that, but I other things (such as the div border to change)
if the scroll is visible or not. I was hoping there was another way to
determine if the div has scroll bars without having to check the
dimension totals of all the elements inside my div.
*** Sent via Developersdex http://www.developersdex.com ***
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.