473,883 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.onmous edown
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 2536
konryd <ko****@gmail.c omwrites:
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.onmous edown
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.javas cript:
>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****@h oehrmann.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.javas cript:
>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.javas cript:
>Bjoern Hoehrmann wrote:
>* konryd wrote in comp.lang.javas cript:
>>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****@h oehrmann.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.javas cript:
>Bjoern Hoehrmann wrote:
>>* konryd wrote in comp.lang.javas cript:
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::ad dEventListener( ) (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
16903
by: Stefano Incontri | last post by:
Hi All, how can I scroll a TextArea to its last position at the bottom? Thanks, Stefano
1
11448
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 the bottom or start at the bottom displaying the last message sent. I am being told there is no way to do this in asp.net and that I will have to do it in javascript. Does anybody have any sample code on how to do this? Many thanks for any...
5
8298
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 (overflow attribute) with the user being able to scroll thru the text using the arrow keys within the textbox. I managed to get the readonly and the overflow part to work but cannot figure out a way to let the user place the cursor within the box and
1
7311
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 gets updated but I have to manually scroll it down to the end. Rob
14
1794
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 a function that I can put into the <text area> tag of each box, something like... <text area onKeyPress="BanCharacters('a','<','>','b','u','i');"> Is this possible easily?
2
6537
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 firefox creates an elastic band effect. The textarea quickly scrolls down then bounces up to the top, no matter what I try. Has anyone run into the same difficulty? How did you solve it?
2
2716
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 i want the scroll bar to be sticking to the bottom always.. Please help..
0
9940
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
11141
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
10742
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
7971
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7126
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
5797
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...
1
4611
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
2
4220
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3232
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.