473,769 Members | 5,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting if onscroll events working / supported in Firefox

Is there a way to detect if an textarea onscroll event is working in
Firefox (or Mozilla). I know that there is an onscroll event bubbling
bug with current vesions of these browsers so I want to detect this
problem with a test like "if (textarea.onscr oll == 'undefined' ||
!textarea.onscr oll) {}." Any help would be appreciated.

Jul 23 '05 #1
1 3412

Mark Szlazak wrote:
Is there a way to detect if an textarea onscroll event is working in
Firefox (or Mozilla). I know that there is an onscroll event bubbling
bug with current vesions of these browsers so I want to detect this
problem with a test like "if (textarea.onscr oll == 'undefined' ||
!textarea.onscr oll) {}." Any help would be appreciated.


I've tried the following code and it seems to work in IE and Firefox on
a Win2k box. Does anyone see problems with it as a test used for
branching to workaround code when a buggy Moz/Firefox browser is being
used?

<html>
<head>
<script>
function isBubbling (ta) {
var bubbling = false, str = '';

ta.onscroll = function () { bubbling = true; }

for (var i=0; i<ta.rows; i++) str += '\n';
ta.value = str;
ta.scrollTop = ta.scrollHeight ;
ta.scrollTop = 0;

ta.value = "";
return bubbling;
}

onload = function ()
{
var ta = document.getEle mentById('ta');

if (isBubbling(ta) )
{
alert('bubbling ');
}
else
{
alert('not bubbling');
}
}
</script>
</head>
<body>
<textarea id="ta" rows=5 cols=40></textarea>
</body>
</html>

Jul 23 '05 #2

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

Similar topics

3
10487
by: viza | last post by:
Hi! I use the onscroll event to make something like the CSS position:fixed; for MSIE. In MSIE/5.5, before a function is assigned to the event handler, it has the value null. In Opera, it is undefined, because Opera doesn't support this event. I use:
5
2359
by: knocte | last post by:
Hello. I am a web developer very worried about "bloat code" and "languages mixture". So, since some time, I always try to avoid completely the use of javascript in XHTML/HTML files. This leads to me to hate, also, any event (onload, onchange, ...) instanciated in the element tag itself, like: <input type="text" onkeyup="return doSomething();" /> I would replace this code above with an input element marked with an
5
20649
by: Simon Wigzell | last post by:
Looks like firefox doesn't support onscroll. Any workaround?
1
12910
by: Simon Wigzell | last post by:
Firefox has strange behaviour with onscroll. I have a sample page here: http://www.dynamicwebsitesystems.com/ScrollTest.htm If I make this the startup page for the firefox browser or launch it from Frontpage with Preview then the onscroll works - it calls the doOnScroll function and posts the alert when you move the scroll bar. It doesn't work if you go to this page from another page or if you refresh the page. What is going on here? Any...
0
2143
by: Jocker | last post by:
Hi Group I'm writing an Internet Explorer plugin. Everything works well, except when I try to handle the onscroll event. http://msdn.microsoft.com/workshop/browser/mshtml/reference/ifaces/window2/onscroll.asp http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onscroll.asp another possibility seems to exist with IHTMLElement2.onscroll using the document body, but this does not solve the problem. the following code snippet...
0
1701
by: Jocker | last post by:
I'll try reposting this message with the hope someone can help me with this issue. PS: is this the right newsgroup for this question? --- Hi Group I'm writing an Internet Explorer plugin. Everything works well, except when I try to handle the onscroll event.
0
2660
by: bluegrasslover | last post by:
I've gotten a couple of emails about this problem lately so I'm going to post the solution that someone emailed me a while back. When you create a master page visual studio automatically adds a <-- doctype ... statement near the top of the master page. Somehow this forces some w3c standard where scrolltop isn't supported. I removed the doctype declaration from my masterpage and everything works fine. Actually I changed the dtd type to...
4
5072
by: wolverine | last post by:
Hi, I want to know when user has stopped scrolling. I can know the beginning of a scroll by attaching the 'onscroll' event. But how do i detect end of scroll. Is there any event for that ? Or is there some other way to know that user has stopped scrolling. I don't want to use 'onmouseup' since user can scroll using mouse wheel as well as keyboard. So could any one help me here ?
15
4233
by: RobG | last post by:
When using createEvent, an eventType parameter must be provided as an argument. This can be one of those specified in DOM 2 or 3 Events, or it might be a proprietary eventType. My problem is testing for support of particular eventTypes - the DOM 2 Events Interface DocumentEvent says that if the eventType is not supported, it throws a DOM exception. This makes testing rather tough - if you try something like: if (document &&...
0
9579
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
10199
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
9849
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8861
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7393
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
6661
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
5433
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3948
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
3
2810
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.