Code: Select all
<a href="e;http://www.foo.com"e;><img src="e;foo.jpg"e;></a>
<a href="e;javascript:firstWindow('bash.htm',170,315)"e;><img src="e;foo.jpg"e;></a>Doable? If so, how is it coded?
Moderator: General Moderators
Code: Select all
<a href="e;http://www.foo.com"e;><img src="e;foo.jpg"e;></a>
<a href="e;javascript:firstWindow('bash.htm',170,315)"e;><img src="e;foo.jpg"e;></a>Code: Select all
<html>
<head><title>something</title>
<script language="Javascript">
function RightMouseWasClicked()
{
if (event.button==2)
{
alert('Right Mouse button was pressed...');
}
}
document.onmousedown=RightMouseButtonWasClicked;
document.oncontextmenu=new Function("return false")
</script>
</head>
<body bgcolor="#000000" onmousedown=RightMouseButtonWasClicked;>
</body>
</html>Code: Select all
function RightMouseWasClicked()
{
if (event.button==2)
return 1; // tell caller to show popup
else return 0; // tell caller to redirect
}Yeah!Bill H wrote:If I understand, the statements on lines 12 & 13 replace the normal mouse button functionality with the new function and render the normal context menu inactive. So within the new function "RightMouseWasClicked" I would need to accomodate both buttons, redirecting the user if the left button was clicked, and invoking the popup for the right button.
It depends. If you want to send them to different places if different images are clicked then it has to be this way. otherwise, it is perfectly ok to have redirecting mechanism inside function's body.Bill H wrote:My mind tells me those two things should not be done within the function, but should be done outside of it based on return values sent by the function.