473,394 Members | 1,715 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,394 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>

Mar 31 '06 #1
1 1930
I forgot to precise, I can't simply add a null event in the <a> since
the links are generated by a DLL and this DLL is used in many
applications.

I know it would have been really easier but I can't do it since too
many other applications depend on it.

Mar 31 '06 #2

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...
0
by: lechatthierry | 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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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...

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.