472,128 Members | 1,671 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Capturing scroll bar usage on textarea

I want to know when a user scrolls the textarea. Since there is no
such an event, I need to scroll all the ways scrolling might be
invoked, that is:
* by pressing keys
* by moving mouse
* by drag'n'dropping the scroll bar

First two are easy to implement, but the third one doesn't trigger
even document.onmousedown
I investigated on firefox and safari under osx.
Any ideas? Or at least firm confirmation that it cannot be
accomplished?

Konrad
Jun 27 '08 #1
5 2394
konryd <ko****@gmail.comwrites:
I want to know when a user scrolls the textarea. Since there is no
such an event, I need to scroll all the ways scrolling might be
invoked, that is:
* by pressing keys
* by moving mouse
* by drag'n'dropping the scroll bar

First two are easy to implement, but the third one doesn't trigger
even document.onmousedown
I investigated on firefox and safari under osx.
Any ideas? Or at least firm confirmation that it cannot be
accomplished?
I haven't tried this with textareas, but the onscroll event works in
the popular browsers on elements with style overflow: scroll / auto.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Jun 27 '08 #2
* konryd wrote in comp.lang.javascript:
>I want to know when a user scrolls the textarea. Since there is no
such an event, I need to scroll all the ways scrolling might be
invoked, that is:
What is wrong with the 'scroll' event? An <textarea onscroll='...'>
certainly works for me in Internet Explorer, perhaps you missed this
event?
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jun 27 '08 #3
Bjoern Hoehrmann wrote:
* konryd wrote in comp.lang.javascript:
>I want to know when a user scrolls the textarea. Since there is no
such an event, I need to scroll all the ways scrolling might be
invoked, that is:

What is wrong with the 'scroll' event?
That it is proprietary.
An <textarea onscroll='...'>
You of all people should know that this is invalid HTML.
certainly works for me in Internet Explorer,
I wonder how you of all people could even think about advocating
invalid HTML just to satisfy Internet Explorer users.
perhaps you missed this event?
Perhaps he was thinking more clearly than you do now.
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Jun 27 '08 #4
* Thomas 'PointedEars' Lahn wrote in comp.lang.javascript:
>Bjoern Hoehrmann wrote:
>* konryd wrote in comp.lang.javascript:
>>I want to know when a user scrolls the textarea. Since there is no
such an event, I need to scroll all the ways scrolling might be
invoked, that is:

What is wrong with the 'scroll' event?

That it is proprietary.
It's actually part of the HTML Events in DOM Level 2 Events. I indeed
neglected to mention that the onscroll attribute is not part of HTML4
and derived formats, thank you for adding that information.
--
Björn Höhrmann · mailto:bj****@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
Jun 27 '08 #5
Bjoern Hoehrmann wrote:
* Thomas 'PointedEars' Lahn wrote in comp.lang.javascript:
>Bjoern Hoehrmann wrote:
>>* konryd wrote in comp.lang.javascript:
I want to know when a user scrolls the textarea. Since there is no
such an event, I need to scroll all the ways scrolling might be
invoked, that is:
What is wrong with the 'scroll' event?
That it is proprietary.

It's actually part of the HTML Events in DOM Level 2 Events.
Yes, indeed! Thank you for pointing this out.
I indeed neglected to mention that the onscroll attribute is not part of
HTML4 and derived formats,
However, since the `scroll' event is part of DOM Level 2 Events one can use
EventTarget::addEventListener() (except for MSHTML where assignment to
..onscroll would have to suffice due to buggy attachEvent()). Great :)
thank you for adding that information.
You are welcome.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Stefano Incontri | last post: by
1 post views Thread by jason | last post: by
5 posts views Thread by pv_kannan | last post: by
1 post views Thread by Rob Webster | last post: by

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.