PDA

View Full Version : Right click or left click on an image


Andy
08-17-2002, 08:10 AM
Is it possible to detect which mouse button has been pressed when clicking on an image?
I would like to run different javascripts when I left or right click on an image so that the image can be increased or decreased in size.
Any advice greatly received

Mhtml
08-17-2002, 10:10 AM
ie 5.0
left click

onClick="yourFunction()"

right click

onContextMenu="yourfunction()"


not sure if the context menu will still popup, if it does a silent no right click script should fix that: http://www.dynamicdrive.com/dynamicindex9/noright3.htm

This is mainly JS related so you should have posted in the JS forum..