1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
a {text-decoration:none}
a:hover{background-color:yellow}
</style>
<script type="text/javascript">
function dispManu(event) {
var el, x, y;
var el = document.getElementById("menu");
if (window.event) {
x = window.event.clientX + document.documentElement.scrollLeft
+ document.body.scrollLeft;
y = window.event.clientY + document.documentElement.scrollTop
+ document.body.scrollTop;
}
else {
x = event.clientX + window.scrollX;
y = event.clientY + window.scrollY;
}
x -= 2; y -= 2;
el.style.left = x + "px";
el.style.top = y + "px";
el.style.display = "";
}
</script>
</head>
<body>
<img src="http://javascript.developpez.com/template/images/logo.gif" onclick="dispManu(event);"/>
<table id="menu" style="display:none; position:absolute" border="1" >
<tr>
<td><a href="">Menu 1</a></td>
</tr>
<tr>
<td><a href="">Menu 2</a></td>
</tr>
<tr>
<td><a href="">Menu 3</a></td>
</tr>
</table>
</body>
</html> |