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

Capturing scroll bar usage on textarea

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
* 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

P: n/a
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

P: n/a
* 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

P: n/a
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.