Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Right clicking in design mode

Status
Not open for further replies.

modalman

Programmer
Feb 14, 2001
156
GB
Does anyone know how I can detect what the mouse has right clicked on when in design mode and how I can generate my own pop up menu if that is possible? E.g What I need to do is show a dialogBox after the user has right clicked on an image or a table. Many thanks in advance. ASCII silly question, get a silly ANSI
 
modalMan,

Yes, this is possible, depending on what version of JavaScript you are attempting to support. Try something like this:

<script language=&quot;JavaScript&quot;>
<!--
function actOnMouseClick() {
if ([the click is the right button]) {
// write code here
}

else {
// write other code here
}
}
//-->
</script>
.
.
.
<a href=&quot;javascript:actOnMouseClick()&quot;>
<img src=&quot;yourImage.gif&quot; height=&quot;30&quot; width=&quot;30&quot;>
</a>

This is just a very simple skeleton of what you need to write but it should give you a pretty good idea.

- DB
Web Developer
Digital Video Arts, LTD.

AIM: dgtlby
ICQ: 68300740
 
Ive been looking for a 'Bookmark this page' script to use when people right click on images.Iknow its impossible to stop people from getting pics but wanted to annoy them with that box. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top