<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="智能社 - zhinengshe.com" />
<meta name="copyright" content="智能社 - zhinengshe.com" />
<title>智能社 - www.zhinengshe.com</title>
<style>
*{margin:;padding:;list-style:none;}
#menu1{display:none; position:absolute;left:;top:;width:100px; border:1px solid #; overflow:hidden;} #menu1 li{width:%; height:30px; line-height:30px; text-align:center; background:#ccc; border-bottom:1px solid #;}
#menu1 li:hover{ background:#c00; color:#fff;}
#ul1 li{float:left;width:200px; height:30px; line-height:30px; text-align:center; background:#ccc; border:1px solid #; margin:10px;} </style>
<script> window.onload = function(){
var oUlMenu = document.getElementById("menu1");
var aMLi = oUlMenu.children;
var oUl = document.getElementById("ul1");
var aLi = oUl.children; var currentLi = null;
for(var i = ; i < aLi.length; i++){
aLi[i].oncontextmenu = function(ev){
currentLi = this;
var oEvent = ev || event;
oUlMenu.style.display = "block";
oUlMenu.style.left = oEvent.clientX + "px";
oUlMenu.style.top = oEvent.clientY + "px"
return false;//禁止默认的鼠标右击出现选项弹窗,和oncontextmenu配合使用
};
} aMLi[].onclick = function(){
currentLi.parentNode.removeChild(currentLi);
oUlMenu.style.display = "none";
}; aMLi[].onclick = function(){
currentLi.style.background = "red";
oUlMenu.style.display = "none";
};
aMLi[].onclick = function(){
currentLi.style.background = "green";
oUlMenu.style.display = "none";
}; }; </script>
</head> <body> <ul id="menu1">
<li>删除</li>
<li>变红</li>
<li>变绿</li>
</ul> <ul id="ul1">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
</body>
</html>

最新文章

  1. sql server left 和right 函数
  2. mybatis中crud操作范例
  3. ApiDoc 文档使用方式
  4. Ehcache BigMemory: 摆脱GC困扰
  5. CSS垂直居中精华总结
  6. UVA 10474 大理石在哪 lower_bound
  7. 手把手教你玩转SOCKET模型之重叠I/O篇(下)
  8. Linux web性能优化
  9. hdu 3874 Necklace(bit树+事先对查询区间右端点排序)
  10. [每日一题] OCP1z0-047 :2013-08-22 正则表达式---[^Ale|ax.r$]&#39;
  11. 新概念英语(1-135)The latest report
  12. LeetCode专题-Python实现之第9题:Palindrome Number
  13. 论PHP框架设计模式及MVC的缺陷
  14. 浅谈现公司的Spring Cloud微服务框架
  15. HTML基本入门完成
  16. go官方的http.request + context样例
  17. Debian Security Advisory(Debian安全报告) DSA-4412-1 drupal7 security update
  18. 51Nod 1135:元根(数论)
  19. JDK动态代理实例
  20. 2018.08.04 bzoj3261: 最大异或和(trie)

热门文章

  1. 20145208蔡野 《网络对抗》逆向及BOF基础实践
  2. keepalived主从及双主配置
  3. javaweb 实战_1
  4. C++ 实验2:函数重载、函数模板、简单类的定义和实现
  5. 04_Windows平台Spark开发环境构建
  6. testNG 学习笔记 Day2 配置testNG自带的监听器
  7. maven 下载不到jar包时候,更改阿里源
  8. 刚创建的maven项目,pom.xml的第一行就报错
  9. django查询集API
  10. Eclipse 打包jar