473,663 Members | 2,719 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detect If Scrollbars Visible

Is there anyway to detect if scrollbars were made visible in a
textarea? I'm not talking about initial setting of the scrolling
attribute, but rather whether scrollbars have been added either
horizontally or vertically based on the users text input?

Thanks,
Cliff.

Jul 23 '05 #1
2 10729
de*******@gmail .com wrote:
Is there anyway to detect if scrollbars were made visible in a
textarea? I'm not talking about initial setting of the scrolling
attribute, but rather whether scrollbars have been added either
horizontally or vertically based on the users text input?


Nope. Well, maybe make the textarea just large enough for a scrollbar
and 1 character visible. But to make a textarea of significant size and
then determine if scrollbars are present, no.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Jul 23 '05 #2
de*******@gmail .com wrote:
Is there anyway to detect if scrollbars were made visible in a
textarea? I'm not talking about initial setting of the scrolling
attribute, but rather whether scrollbars have been added either
horizontally or vertically based on the users text input?

Thanks,
Cliff.


Have a play at this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
</head>
<body>
<form>
<input type="text" name="sc" value="">
<br>
<textarea
rows="3"
cols="24"
wrap="soft"
onkeyup="
sH.value=a=this .scrollHeight;
oH.value=b=this .offsetHeight;
sW.value=c=this .scrollWidth;
oW.value=d=this .offsetWidth;
sc.value=(a>b|| c>d)?'scrolling ...':''"></textarea>
<hr>
<input type="text" name="sH" value="">__scro llHeight
<br>
<input type="text" name="oH" value="">__offs etHeight
<hr>
<input type="text" name="sW" value="">__scro llWidth
<br>
<input type="text" name="oW" value="">__offs etWidth
<hr>
</form>
</body>
</html>

Some sort of algorithm in there somewhere...

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
11472
by: adrien | last post by:
Hi, (also posted in netscape.public.mozilla.browser) i use netscape 7 and want to hide the scrollbars of the window when something happens. I tried this: window.scrollbars.visible=false window.scrollbars.visibility="no" .... nothing works Is it also possible only to hide the vertical scrollbar instead of both?
24
4694
by: Nobody | last post by:
Okay, you are all so smart in here. Answer me this: IE6 in standards mode doesn't seem to hide scrollbars on the body element (overflow:hide) Ain't this a quandary. I have it in my head that I need to specify html instead. The scrollbars do hide on Gecko browsers though, so there is definitely a disagreement among browser developers on how to implement scrollbars (as a side note, Gecko browsers with their notoriously bug-ridden...
6
3374
by: CJM | last post by:
I've been trying to tweak the design of a few pages in one of my ASP apps... I'm making sure that the layout is reasonable for resolutions between 800x600 and 1024x768. Since it's almost all forms (rather than text) it takes a bit of extra effort to find the right balance. At the higher resolution, everything is fine. When I reduce the IE window to 800x600 (via bookmarklet), I'm getting both horizontal and vertical scrollbars; the...
3
17299
by: andrew.neale | last post by:
Hello, I have a div that has an overflow set to auto. I would like to know if the scrollbars are visible in javascript. Any help is appreciated. Thanks
1
17521
by: Kristof Nachtergaele | last post by:
Hi, I'm looking for something, which acts as a container, that I can drop onto my form and which has a size that is bigger than the visible part, the invisible pazrt being scrollable to with scrollbars. Actually it boils down to a form in a form in a certain way, does anyone have any idea if there is allready such a component around somewhere, and if not from which class to start to create it? thx,
5
4938
by: MrNobody | last post by:
I'm doing some custom drawing to a Panel object overriding the onPaint, and the stuff I draw usually goes beyond the ClipRectangle of the panel's current size- so I set autoscroll to true yet it never shows scrollbars. I also tried putting my custom Panel inside of a regular Panel with Autoscroll true andf it still does not work. What can I do to make scrollbars appear? Is there a size setting I have to change on my Panel so that it...
10
2171
by: GTi | last post by:
I have a popup window, If this window is to smaal the scrollbars is visible. Is there any JavaScript available so I can check if the scrollbars is visible on page (right and bottom side)? Then I can auto resize the window so it dosen't show (until a maximums size).
0
1556
by: Sin Jeong-hun | last post by:
I need to create a table user control. The table will display many cells so this control requires scrollbars should be displayed when some cells cannot be displayed. At first, I draw the table on a UserControl, and resized the UserControl to the exact size of table and placed it on a Panel whose AutoScroll is true. So when the table(actually a UserControl) gets bigger, the Panel displays scrollbars automaticaly, this seemed fine. But...
1
6236
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, Is there a way to detect whenever scrollbars (the vertical) are shown on a treeview I need to know. 1) If scrollbars are visible after a rezise 2) If scrollbars are visible after change in content (e.g. nodes collapsed/expanded, nodes added/deleted ). Any event to hook into?
0
8435
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8857
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8547
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7368
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5655
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4348
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.