Does anyone know how to detect when a popup-menu appears?
Thanks
Printable View
Does anyone know how to detect when a popup-menu appears?
Thanks
You can use the Click event for that menu.
For example, if you had menuFile (the top one), and two others which are under it menuFileOpen and menuFileClose and you use Popupmenu menuFile. You detect when menuFile pops up by using menuFile's Click event.
Sunny
Thanks!
I am talking about Internet Explorer popup.
Anyone?
Try this:
This code will prevent it from displaying if you just want to detect it take out the 'return false' in the BODY tag. You can also use this same thing on specific elements to prevent right clicking on only certain elements.Code:<HTML>
<HEAD>
<SCRIPT language="Javascript">
function menuhandler()
{
window.alert("Stop that!");
}
</SCRIPT>
</HEAD>
<BODY oncontextmenu="menuhandler();return false">
</BODY>
</HTML>
Keep in mind however, that keeping someone who knows what they are doing from saving images on a web page or viewing source is not possible. If I'm viewing a site and I want the image I see, I know it's already on my drive in my Temporary Internet Files folder and I can always view source from the View menu.
(I'm assuming that's what your trying to do..)
Thanks Monte, but I am talking about if there is any API to detect the popup menu from internet explorer.