</ul>
<script>
document.addEventListener("contextmenu",function(evt){
evt.preventDefault()
list.style.display="block"
if(x >= document.documentElement.clientWidth-list.offsetWidth){
x=document.documentElement.clientWidth-list.offsetWidth
}
if(y >= document.documentElement.clientHeight-list.offsetHeight){
y=document.documentElement.clientHeight-list.offsetHeight
}
var x=evt.clientX
var y=evt.clientY
list.style.left=x + "px"
list.style.top=y + "px"
})
document.addEventListener("click",()=>{
list.style.display="none"
})
list.onclick=function(evt){
console.log("list",evt.target)
if(evt.target.className==="aaa"){
console.log(111111)
}
}
</script>
document.addEventListener("contextmenu",function(evt){
evt.preventDefault()
list.style.display="block"
if(x >= document.documentElement.clientWidth-list.offsetWidth){
x=document.documentElement.clientWidth-list.offsetWidth
}
if(y >= document.documentElement.clientHeight-list.offsetHeight){
y=document.documentElement.clientHeight-list.offsetHeight
}
var x=evt.clientX
var y=evt.clientY
list.style.left=x + "px"
list.style.top=y + "px"
})
document.addEventListener("click",()=>{
list.style.display="none"
})
list.onclick=function(evt){
console.log("list",evt.target)
if(evt.target.className==="aaa"){
console.log(111111)
}
}
手机扫一扫
移动阅读更方便
你可能感兴趣的文章