?
Solved

oncontextmenu on Image Map

Posted on 2003-02-22
4
Medium Priority
?
265 Views
Last Modified: 2010-08-05
Hi,

I am have an image map and I would like to use oncontextmenu for differents
right click menu for each area.

I used the following code but it does not seem to work (using IE 5.5), any
ideas ?


<body>
<img src="panel_EVB2.gif" width="772" height="105" border="0" usemap="#Map">
<map name="Map">
  <area shape="rect" onClick="alert('left');" oncontextmenu="if
(!event.ctrlKey){alert(Right Click');return false;}" coords="280,25,363,69"
href="http://www.cnn.com">
</map>
</body>

Thanks,

Yaron

0
Comment
Question by:cyaron
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Accepted Solution

by:
gator4life earned 200 total points
ID: 8002006
cyaron -

I think this is a bug in the Internet Explorer browser, because I am running IE 6.0 and it does not work for me either.  When I checked the MSDN Library, Microsoft's documentation states that the onContextMenu event is exposed by the <area> object: http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/area.asp

Just to make sure that this event was firing, I created a <div> to test:

<div oncontextmenu="if (!event.ctrlKey) {window.alert('Right Click'); return false;}">Test onContextMenu Event</div>

This worked just like it should have, so I think that the event not firing on the <area> object is a bug.

gator4life
(chomp, chomp)
0
 

Author Comment

by:cyaron
ID: 8002573
Thanks for your help,

Yaron
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10083294
*******************************************************
******PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER******
*******************************************************
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area:
RECOMMENDATION:

 - [Points to gator4life Grade A]

Please leave any comments here within the next seven days.
*******************************************************
******PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER******
*******************************************************

jAy
EE Cleanup Volunteer
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question