473,396 Members | 2,018 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.

Is it possible to block a mouse event on an Hyperlink with a general script event

Is it possible to block a mouse event on an Hyperlink with a general
script event?

This is quite troublesome for me. I am trying to find a way to block
the windows shortcut SHIFT + MOUSE LEFT BUTTON that open the Hyperlink
in a new window for a Web application. I just want to capture the Shift
click event and prevent it from opening a new page.

Mouse Wheel didn't pose any problems but the other mouse buttons seems
to ignore the cancelBubble proprety.

I'v seen few messages of people saying that they couldn't not make it
work with IE6 and some answers what it did work with IE5. I couldn't
try on IE5 but I tried it on IE7Beta and it Dindn't work.

As I sayd before, only the mouse button seems to not work. Mouse Wheel
work fine.

It may be because the activation of the event click on an Hypertext
have an higher priority than the event in the code and therefore the
annulation of the bubble is useless since the action have been alredy
launch but if if you add a MsgBox("") in the code, there is no new page
opened.

If anyone have a clue about how to solve my problem I would really
appreciate.

P.S.: A way to pass by this problem could be to remove the SHIFT
modificator and simply open a page the normal way but I coudn't find
anything on that either. (But I don't NEED the page to be open on a
shift click, just blocking the event would be really nice)

<script language="vbscript" for="document" event="onmousedown">
<!--
IF window.event.shiftKey THEN
window.event.returnValue = FALSE
window.event.cancelBubble = TRUE
END IF
//-->
</script>
<script language="vbscript" for="document" event="onmouseclick">
<!--
IF window.event.shiftKey THEN
window.event.returnValue = FALSE
window.event.cancelBubble = TRUE
END IF
//-->
</script>
<script language="vbscript" for="document" event="onmouseup">
<!--
IF window.event.shiftKey THEN
window.event.returnValue = FALSE
window.event.cancelBubble = TRUE
END IF
//-->
</script>


<script language="vbscript" for="document" event="onmousewheel">
<!--
IF window.event.shiftKey THEN
window.event.returnValue = FALSE
window.event.cancelBubble = TRUE
END IF
//-->
</script>

Thank you for your time

Mar 31 '06 #1
0 1811

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

Similar topics

0
by: Mike | last post by:
I noticed from the msdn help that posting a large message to the event log is a bad practice. Logging a path to a file is better in this instance. Is it possible to send a hyperlink in an event log...
2
by: cmelnick | last post by:
I need to determine whether the user used the right or left mouse button to click an element on a form. AFAIK, there is no way to determine this from the Click (or DoubleClick) event. I currently...
1
by: seash | last post by:
hi friends I need to call an event (private void groupBox4_Enter(object sender, System.EventArgs e)) from an another event (private void Appexit_Closing(object sender,...
5
by: OC | last post by:
I would like to trigger another event from within an event that is specific to a forms state at the time of the original event. Is this possible?
2
by: Alex Sedow | last post by:
Why interface-event-declaration does not support multiple declarators like event-declaration? Grammar from C# spec: variable-declarators: variable-declarator variable-declarators ","...
1
by: | last post by:
Hi How can I trigger a button_click event in c#, please? I have tried calling the event directly, but the event was looking for some parameters such as sender and eventarguments which I don't know...
1
by: Neko | last post by:
Is it possible to block a mouse event on an Hyperlink with a general script event? This is quite troublesome for me. I am trying to find a way to block the windows shortcut SHIFT + MOUSE LEFT...
2
by: cumars | last post by:
Hello Friends, I want to trigger both the click event and double click event in a single button separately. (i.e.) the user can trigger both the single click and the double...
3
by: GauravGupta | last post by:
i want to know that is it posible to call button click event before page load event on post back.... please help me....
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: 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...
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
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,...
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
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
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...

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.