<style>
#menu {
display: none;
position: absolute;
top: 0px;
left: 0px;
}
ul{
/*去点*/
list-style-type: none;
margin: 0px;
padding: 5px;
border: 1px solid #272822;
}
/*去下划线*/
ul a{
text-decoration: none;
color: #000;
}
</style>
<div id="menu">
<ul>
<li><a href="www.baidu.com" target="_blank">百度</a></li>
<li><a href="www.baidu.com" target="_blank">百度1</a></li>
<li><a href="www.baidu.com" target="_blank">百度2</a></li>
</ul>
</div>
<script>
document.oncontextmenu = function (event) {
x = event.clientX;
y = event.clientY;
menu.style.left = x + 15 +'px';
menu.style.top = y + 15+ 'px';
menu.style.display = 'inline';
return false;
}
</script>
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/4dd16514e151d1922b15c1fc61f7463d.png)