473,395 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Determine if scrollbar is visible?

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
2 4305
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Barbara de Zoete | last post by:
On one of my pages http://home.wanadoo.nl/b.de.zoete/html/tekeningen.html I have a div containing thumbnails (who ever came up with that word?) to select a larger view of a picture. The div is...
5
by: Spondishy | last post by:
Hi, I am using the following in my stylesheet to center divs in firefox. html>body { font-size: 13px; } div.centerdiv {
0
by: Shravan | last post by:
Hi, I have a custom datagrid extended from .Net datagrid, where I want vertical scrollbar to be visible always, for that I handled visiblechanged of VerticalScrollbar and making it visible...
1
by: Goffin | last post by:
Hey I have an asp.net datagrid width a scrollbar. This scrollbar is placed using a div-tag around the grid with a style property overflow:scrolling, a width an a height. This works very well in...
22
by: Colin McGuire | last post by:
I apologize for posting yet another scrollbar question. Here is my code. All I want is for a diagonal line to appear from coordinates (0,0) to (width,height) in a usercontrol regardless of whether...
0
by: Mr. Beck | last post by:
I have a simple application that has a listbox for displaying text in it. The functionality of it is to color particular parts of the text that is displayed from a file. I have used similar coding...
1
by: scott8000 | last post by:
hi all Access 2K/2003, Win XP Pro I need to be able to detect when a subform datasheet is currently displaying a vertical scrollbar. I.e if the subform datasheet is showing more records...
2
by: Sin Jeong-hun | last post by:
Is it possible to get current visible rect when there is a scrollbar on the ListBox? Say, if the ListBox is in Details mode, and there are 1000 lines. The user has scrolled down to 500th line...
4
by: ShaneO | last post by:
In a Windows Form I have a RichTextBox with Multiline = True and ScrollBars = Vertical. As expected, when Text is loaded into the RTB the Vertical ScrollBar will appear if needed. Does anyone...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.