473,396 Members | 2,061 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,396 software developers and data experts.

Disable Mouse Events

SJ
Dear Friends,

I want to temporaraly disable events from my page. However, I cant seem
to get it to work. It will show my disables message, but then it goes
ahead and does the action I was trying to do (like clicking on a link).

Here is the code, any ideas?
-----
function disableEvents()
{
document.onclick = showDisabledMessage;
}
function enableEvents()
{
document.onclick = null;
}
function showDisabledMessage()
{
alert("Please wait for the current action to complete.");
return false;
}

Jan 8 '07 #1
2 13479

SJ wrote:
Dear Friends,

I want to temporaraly disable events from my page. However, I cant seem
to get it to work. It will show my disables message, but then it goes
ahead and does the action I was trying to do (like clicking on a link).
Learn about javascript events, in paticular event order and bubbling.

<URL: http://www.quirksmode.org/js/introevents.html >
Your code only adds/removes a handler for the document object's click
event, it doesn't affect the triggering of any other DOM object's
event, or other events for the document object.

--
Rob

Jan 9 '07 #2
SJ
This is perfect. Thanks a bunch!
RobG wrote:
SJ wrote:
Dear Friends,

I want to temporaraly disable events from my page. However, I cant seem
to get it to work. It will show my disables message, but then it goes
ahead and does the action I was trying to do (like clicking on a link).

Learn about javascript events, in paticular event order and bubbling.

<URL: http://www.quirksmode.org/js/introevents.html >
Your code only adds/removes a handler for the document object's click
event, it doesn't affect the triggering of any other DOM object's
event, or other events for the document object.

--
Rob
Jan 9 '07 #3

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

Similar topics

5
by: John Champaign | last post by:
Hi all, I'm working on an educational applet for a child with special needs. He's got a bit of a trick to make my life more difficult... To interact with the applet he needs to click on...
6
by: nntp | last post by:
I have a set of links which I want search engines to crawl them, but I want to disable them from my visitors, so I will ask the link owners to pay me to let me enable them. <a disabled...
2
by: Dw70 | last post by:
I need write simple program with work in background and have only one function when it is run F1 I disable and when I pres for example ctrl+k it (program is terminate) maybe somebody have...
0
by: 6tc1 | last post by:
Hi all, I've got a UserControl that contains a few PictureBox objects. If I click on outside of the Picture in the UserControl, the scrolling with the mouse button works - however, no amount of...
2
by: bartlomiej.szafraniec | last post by:
Hi! I'm trying to implement custom button. But I don't want to extend Button class. I want to extend Control class. I want to implement Enable disable functionality. But unfortunatly when...
0
by: esakal | last post by:
Hello, I'm using .net 2 C#. I would like to change the layout of the Disable so it will looks like it is enable but the user will not be able to focus on the control nor entring him with...
4
by: Jon Slaughter | last post by:
Is there any method to temporarily disable focus changing?(I assume only method is tab or mouse?) This problem has been tieing me up for a while and nothing seems to work. The only thing that I...
5
by: Sehboo | last post by:
In my application, there are lot of processes which take several seconds. What we want is that once user clicks on a button (or link or whatever) and while we are processing that request, we don't...
8
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? -----------------------------------------------------------------------...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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
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
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,...

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.