<! DOCTYPE html>
<meta charset= "UTF-8" >
<title> Customize the right-click menu </title>
<style>
*{margin:0;padding:0;}
ul{display:none;list-style:none;width:80px;height:100px;border:1px solid #000;p Osition:absolute;}
To pay attention to the setting of the style, UL to set wide and absolute positioning, in order to move, outside the margin is set to 0, to be close to the mouse, or there will be a distance.
</style>
<script src= "Jquery-1.9.1.js" ></script>
<script>
$ (document). ContextMenu (function (EV) {//Popup Right-click menu event
$ ("ul"). CSS ("Display", "block");
$ ("ul"). CSS ("left", Ev.pagex); Let the UL left and top for the mouse coordinates, can follow the mouse movement
$ ("ul"). CSS ("top", ev.pagey);
return false; Block Right-click Pop-up menu (that is, block system default event) if the above is true
});
</script>
<body>
<ul>
<li> Login </li>
<li> Registration </li>
<li> Submit </li>
<li> message </li>
</ul>
</body>
Customizing the right-click menu