473,378 Members | 1,699 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,378 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 2481
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Stefano Incontri | last post by:
Hi All, how can I scroll a TextArea to its last position at the bottom? Thanks, Stefano
1
by: jason | last post by:
Hello. I've written this web application in asp.net and have a textarea what I will use like a chat box. The box will be frequently refreshing. I need the textarea to *automatically* scroll to...
5
by: pv_kannan | last post by:
Hello, I am stuck with a problem trying to mimic the behavior of a Windows Forms Readonly textbox in HMTL/ASP.NET. Basically, I would like the text to be readonly and overflow the textbox...
1
by: Rob Webster | last post by:
Hi, is there a way using JavaScript to tell a textarea to scroll to the end of it's contents? I'm implementing something that looks like messenger using web forms, after each post the chat area...
14
by: @sh | last post by:
Has anyone a function handy that I can apply to various textboxes within a form, each textbox will permit most characters but I want to ban certain characters from each textbox. Therefore I need...
2
by: rjonasz | last post by:
Hey Everyone, I'm trying to scroll a textarea to the position of the caret which is below the visible area of the textarea in firefox. I have code which works in IE but the code I use for...
2
by: ScripterSam | last post by:
Hello friends, I have a html textarea with the vertical scroll buttons on. This textarea shows logs to the user.. What i need is that the textarea should show me only the latest logs... precisely...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.