473,498 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stopping an onMouseDown process when the mouse is up

Hello:

I would like a process to continue as long as the mouse is held down on
a button and to stop as soon as it is released. Something ideally like
this:
"while (ButtonIsDown) {i+ = 1}"

I tried the following in the button tag:

onMouseDown = "isDown = true; while(isDown) {i+=1}"
onMouseUp = "isDown = false"

but the mouseup event does not interrupt the onMouseDown process, so the
loop will continue endlessly.

The same kind of thing happens in the <bodyevents; one will not
interrupt the other.

I would appreciate any suggestions.

st******@optonline.net
Sep 9 '06 #1
2 1322

stef wrote:
Hello:
Your followup-to field appears to be incorreclty set.
>
I would like a process to continue as long as the mouse is held down on
a button and to stop as soon as it is released. Something ideally like
this:
This thread covers it (seach for "onmousedown is not what I expect"):

<URL:
http://groups.google.com.au/group/co...0937955a293fd3
>

--
Rob

Sep 9 '06 #2
In article <11*********************@p79g2000cwp.googlegroups. com>,
"RobG" <rg***@iinet.net.auwrote:
stef wrote:
Hello:

Your followup-to field appears to be incorreclty set.

I would like a process to continue as long as the mouse is held down on
a button and to stop as soon as it is released. Something ideally like
this:

This thread covers it (seach for "onmousedown is not what I expect"):

<URL:
http://groups.google.com.au/group/co...m/thread/1a5c0
02d226bccaf/ae0937955a293fd3?lnk=gst&q=onmousedown+is+not+what +I+expect+in+Jav
aScript&rnum=1#ae0937955a293fd3

Hello:

Thanks for the information - using the timeout as suggested in the
thread you mention completely solves my problem!

Stef
Sep 12 '06 #3

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

Similar topics

4
4937
by: RelaxoRy | last post by:
Is there any way to stop someone getting their mouse and selecting text on a page (without making the text an image of course). Is it possible to trap and stop click-and-drag functionality from...
3
17288
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting...
2
6194
by: Bender | last post by:
Hi, I am wanting to capture an onmousedown event without firing the body tags onload event. Also, if anyone could explain why this happens that would be excellent. I can't see how an...
1
1389
by: sameth | last post by:
I wrote a script that uses onmousedown and onmouseup in javascript that works great in ie and firefox on windows2000. It looks as if the pocketpc 2003 ie browser dosn't support onmousedown or...
6
4715
by: RC | last post by:
<a href="#" onmousedown="callMyFunction()">Press the mouse button</a> What I expect is when I or an user move mouse pointer over that link, and press the mouse button. Then will...
9
7568
by: jon | last post by:
Hello, I'm trying to experiment with some javascript to do some custom dragdrop handling. I wish to use the onMouseDown event to trigger the start of my drag, and onMouseup for a potentential...
14
13310
by: > Adrian | last post by:
Is there a way of stopping text from highlighting in textbox? Many thanks, Adrian.
0
7197
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...
1
6881
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
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...
0
5456
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,...
0
4584
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...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1411
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 ...
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
287
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...

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.