473,246 Members | 1,450 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,246 software developers and data experts.

Detect if overflow required

I am toying with a javascript scrollbar for a DIV, and am trying to
make it as accessible as possible, I have succeeded on the most part,
but there is a slight problem due to the fact that it isn't a real
scrollbar, I believe the best way is to detect whether overflow is
required, then have it display the newscrollbar and hide the old one!

Anybody have any ideas on whether this is possible, was previously
trying to get style.height, but was not getting any value for the
resizeable box as nothing had been declared, it was resized via text.

Cheers for any help you may be able to give.

Dan Duke

Aug 14 '07 #1
9 3681
wrote on 14 aug 2007 in comp.lang.javascript:
I am toying with a javascript scrollbar for a DIV, and am trying to
make it as accessible as possible, I have succeeded on the most part,
but there is a slight problem due to the fact that it isn't a real
scrollbar, I believe the best way is to detect whether overflow is
required, then have it display the newscrollbar and hide the old one!

Anybody have any ideas on whether this is possible, was previously
trying to get style.height,
try element.offsetHeight
but was not getting any value for the
resizeable box as nothing had been declared, it was resized via text.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 14 '07 #2
On Aug 14, 4:21 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
wrote on 14 aug 2007 in comp.lang.javascript:
I am toying with a javascript scrollbar for a DIV, and am trying to
make it as accessible as possible, I have succeeded on the most part,
but there is a slight problem due to the fact that it isn't a real
scrollbar, I believe the best way is to detect whether overflow is
required, then have it display the newscrollbar and hide the old one!
Anybody have any ideas on whether this is possible, was previously
trying to get style.height,

try element.offsetHeight
but was not getting any value for the
resizeable box as nothing had been declared, it was resized via text.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
awesome, that seemed to do the job perfectly, the only problem is that
it doesn't pick up when the user changes the font size in the browser,
is there a way to get a javascript function to run when the user does
this?

Cheers for your help

Dan

Aug 16 '07 #3
re*******@googlemail.com wrote on 16 aug 2007 in comp.lang.javascript:
On Aug 14, 4:21 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
> wrote on 14 aug 2007 in comp.lang.javascript:
I am toying with a javascript scrollbar for a DIV, and am trying to
make it as accessible as possible, I have succeeded on the most part,
but there is a slight problem due to the fact that it isn't a real
scrollbar, I believe the best way is to detect whether overflow is
required, then have it display the newscrollbar and hide the old one!
Anybody have any ideas on whether this is possible, was previously
trying to get style.height,

try element.offsetHeight
but was not getting any value for the
resizeable box as nothing had been declared, it was resized via text.
[Please do not quoote signatures on usenet]
>
awesome, that seemed to do the job perfectly, the only problem is that
it doesn't pick up when the user changes the font size in the browser,
is there a way to get a javascript function to run when the user does
this?
Just specify fixed font.
[Beware the wrath of the CSS gurus.]

<style type='text/css'>
body {font-size:14pt;}
</style>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 16 '07 #4
On Aug 16, 10:35 am, "Evertjan." <exjxw.hannivo...@interxnl.net>
wrote:
retrod...@googlemail.com wrote on 16 aug 2007 in comp.lang.javascript:
On Aug 14, 4:21 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
wrote on 14 aug 2007 in comp.lang.javascript:
I am toying with a javascript scrollbar for a DIV, and am trying to
make it as accessible as possible, I have succeeded on the most part,
but there is a slight problem due to the fact that it isn't a real
scrollbar, I believe the best way is to detect whether overflow is
required, then have it display the newscrollbar and hide the old one!
Anybody have any ideas on whether this is possible, was previously
trying to get style.height,
try element.offsetHeight
but was not getting any value for the
resizeable box as nothing had been declared, it was resized via text.

[Please do not quoote signatures on usenet]
awesome, that seemed to do the job perfectly, the only problem is that
it doesn't pick up when the user changes the font size in the browser,
is there a way to get a javascript function to run when the user does
this?

Just specify fixed font.
[Beware the wrath of the CSS gurus.]

<style type='text/css'>
body {font-size:14pt;}
</style>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Users can still alter the text size even if font-size is set. For
example in firefox you just hold down ctrl and move the mouses scroll
wheel to increase/decrease the font-size.

So sadly this wont get around my problem in the long term! Any other
ideas please.

Dan

Aug 16 '07 #5
re*******@googlemail.com wrote on 16 aug 2007 in comp.lang.javascript:
but was not getting any value for the
resizeable box as nothing had been declared, it was resized via
text.

[Please do not quoote signatures on usenet]
awesome, that seemed to do the job perfectly, the only problem is
that it doesn't pick up when the user changes the font size in the
browser, is there a way to get a javascript function to run when
the user does this?

Just specify fixed font.
[Beware the wrath of the CSS gurus.]

<style type='text/css'>
body {font-size:14pt;}
</style>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Why do you think I wrote this?
>[Please do not quoote signatures on usenet]
Users can still alter the text size even if font-size is set. For
example in firefox you just hold down ctrl and move the mouses scroll
wheel to increase/decrease the font-size.

So sadly this wont get around my problem in the long term! Any other
ideas please.
No, your problem seeme to be, that you expect html on different browsers
and different browser settings to show exactly the same correct picture.

That is not what html and the www is about, you should expect a
reasonable nice view on the majority of browsers, standard settings and
standard available fonts, and so also a reasonable javascript effext on
view manipulation.
... in the long term ...
I don't know what you mean by that n this case.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 16 '07 #6
re*******@googlemail.com wrote:
[...] "Evertjan." [...] wrote:
>retrod...@googlemail.com wrote on 16 aug 2007 in comp.lang.javascript:
>>On Aug 14, 4:21 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
wrote on 14 aug 2007 in comp.lang.javascript:
I am toying with a javascript scrollbar for a DIV, and am trying to
awesome, that seemed to do the job perfectly, the only problem is that
it doesn't pick up when the user changes the font size in the browser,
is there a way to get a javascript function to run when the user does
this?
Just specify fixed font.
[Beware the wrath of the CSS gurus.]
It isn't wrath, it is merely complete incomprehension how someone could post
such a nonsense *knowlingly*.
><style type='text/css'>
body {font-size:14pt;}
That font size will be different among computers because the `pt' size is
defined by the font resolution which in turn is defined by the display
resolution which is defined by the capabilities of the underlying graphics
hardware and of the GUI. And, as the OP observed, pt-sized fonts can be
scaled everywhere.

px-sized fonts cannot be scaled per menu in Internet Explorer 6. However,
since the actual pixel size depends directly on display resolution (which
can render the px-sized font illegible as well), it is not a unit
recommended for screen fonts.

It is common knowledge that font sizes for the screen should be specified
using the units `em' or `%', with 1em = 100% being relative to the font-size
of the next font-size formatted ancestor element, or to the default user
stylesheet.
></style>
[...]
Please trim your quotes as you already have been asked to.
Users can still alter the text size even if font-size is set. For
example in firefox you just hold down ctrl and move the mouses scroll
wheel to increase/decrease the font-size.
Or press Ctrl+[+-].
So sadly this wont get around my problem in the long term! Any other
ideas please.
Since there is no cross-browser event for scaling fonts, it would appear
that you are out of luck.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Aug 16 '07 #7
Thomas 'PointedEars' Lahn wrote on 16 aug 2007 in comp.lang.javascript:
re*******@googlemail.com wrote:
>[...] "Evertjan." [...] wrote:
>>retrod...@googlemail.com wrote on 16 aug 2007 in
comp.lang.javascript:
On Aug 14, 4:21 pm, "Evertjan." <exjxw.hannivo...@interxnl.net>
wrote:
wrote on 14 aug 2007 in comp.lang.javascript:
>I am toying with a javascript scrollbar for a DIV, and am trying
>to
awesome, that seemed to do the job perfectly, the only problem is
that it doesn't pick up when the user changes the font size in the
browser, is there a way to get a javascript function to run when
the user does this?
Just specify fixed font.
[Beware the wrath of the CSS gurus.]

It isn't wrath, it is merely complete incomprehension how someone
could post such a nonsense *knowlingly*.
>><style type='text/css'>
body {font-size:14pt;}

That font size will be different among computers because the `pt' size
is defined by the font resolution which in turn is defined by the
display resolution which is defined by the capabilities of the
underlying graphics hardware and of the GUI. And, as the OP observed,
pt-sized fonts can be scaled everywhere.
Oh, dear pointed, when do you start to be all ears to the problem first,
so that your often to the point[ed] remarks would hit the mark?

The absolute measures of the points, pointed, are not important here,
only that they do not change with simple browser size changing
AFTER page completion and offsetHeight detection.

This would help under IE, but less so in other browsers.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 16 '07 #8
Cheers, guys, a friend has just suggested another idea, and that is to
watch offsetHeight, so I would need to set up an eventListener, so
that as offsetHeight changes, it runs a function. Sorry about the
newby questions, but any help would be much appreciated.

Dan

Aug 17 '07 #9
re*******@googlemail.com wrote on 17 aug 2007 in comp.lang.javascript:
Cheers, guys, a friend has just suggested another idea, and that is to
watch offsetHeight, so I would need to set up an eventListener, so
that as offsetHeight changes, it runs a function. Sorry about the
newby questions, but any help would be much appreciated.
[please always quote on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 17 '07 #10

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

Similar topics

1
by: John Black | last post by:
Hi, If I have many integer calculation in my code, what's the best way to detect integer overflow? unsigned int i1 = 0xFFFFFF00, i2 = 0xFFFF; then in statement unsigned int i3 = i1 + i2;...
3
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
2
by: Robert McEuen | last post by:
Using Access 97, Windows XP I'm receiving a Numeric Field Overflow error during text import that I did not receive before I split my database. Another thread I found suggested that the cause of...
5
by: ip4ram | last post by:
I am quite puzzled by the stack overflow which I am encountering.Here is the pseudocode //define stack structure //function operating on stack void my_stack_function( function parameters) {...
27
by: REH | last post by:
I asked this on c.l.c++, but they suggested you folks may be better able to answer. Basically, I am trying to write code to detect overflows in signed integer math. I am trying to make it as...
0
by: Marco Segurini | last post by:
Hi, I am trying to dynamically install/deinstall a message handler to a System.Windows.Forms.Form using NativeWindow. I do not use IMessageFilter derived class because it intercept only the...
2
by: jay | last post by:
I am attempting to impersonate an account in ASPNET. I am using aspnet_setreg to store the username and passwords. I have given the ASPNET account permisision to read the registry values. However,...
4
by: mhart | last post by:
I'm using a fixed width <DIV> with the following CSS style assigned: text-overflow:ellipsis; overflow:hidden; Does anyone know how, using Javascript, to detect whether the <DIV> has...
30
by: Angel Tsankov | last post by:
Hello! Does the C++ standard define what happens when the size argument of void* operator new(size_t size) cannot represent the total number of bytes to be allocated? For example: struct S {...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...

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.