bench
01-18-2003, 06:19 PM
I have tried to create a right-click menu on a webpage, but am unable to create a menu for an iframe. So far I have achieved the following:
<html>
<head>
<title>New Page 1</title>
</head>
<script>
document.oncontextmenu = rightmenu;
function rightmenu(){
var popupMenu = window.createPopup();
var x = event.clientX;
var y = event.clientY;
var menu = popupMenu.document.body;
menu.style.backgroundColor = "C0C0C0";
menu.innerHTML = "Morning!";
popupMenu.show(x, y, 100, 100, document.body);
return false;
}
</script>
<body>
</body>
</html>
This allows the menu to appear on a normally webpage document. How would I make this appear in an iframe with the unqiue frame id of 'editor'.
Any help with this would be most appreciated.
Many Thanks,
Ben Chivers
<html>
<head>
<title>New Page 1</title>
</head>
<script>
document.oncontextmenu = rightmenu;
function rightmenu(){
var popupMenu = window.createPopup();
var x = event.clientX;
var y = event.clientY;
var menu = popupMenu.document.body;
menu.style.backgroundColor = "C0C0C0";
menu.innerHTML = "Morning!";
popupMenu.show(x, y, 100, 100, document.body);
return false;
}
</script>
<body>
</body>
</html>
This allows the menu to appear on a normally webpage document. How would I make this appear in an iframe with the unqiue frame id of 'editor'.
Any help with this would be most appreciated.
Many Thanks,
Ben Chivers