http://www.zhangxinxu.com/wordpress/?p=1667

 <%@ page contentType="text/html; charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>jQuerySmartMenuDemo</title>
<link rel="stylesheet" href="../component/alertifyjs/css/themes/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Droid+Sans:400,700">
<script type="text/javascript" src="../component/jquery-1.11.1.js"></script> <script type="text/javascript" src="../component/jQuerySmartMenu/js/jquery-smartMenu.js"></script>
<link rel="stylesheet" href="../component/jQuerySmartMenu/css/smartMenu.css">
<script type="text/javascript">
$(function() {
$("#table tr").bind("mousedown", function (e) {
$.smartMenu.remove();//重新加载smartMenu,这很重要,不然会使用html的缓存
if (e.which == 3) {
var opertionn = {
name: "",
offsetX: 2,
offsetY: 2,
textLimit: 10,
beforeShow: $.noop,
afterShow: $.noop
};
var oneObj = new Object;
oneObj.text = "标题";
oneObj.func = function(){
alert("我被点击了1");
};
var twoObj = new Object;
twoObj.text = "已读";
twoObj.func = function(){
alert("我被点击了2");
};
var imageMenuData = new Array();
var imageMenuDataChild = new Array();
imageMenuDataChild.push(oneObj);
imageMenuDataChild.push(twoObj);
imageMenuData.push(imageMenuDataChild);
$(this).smartMenu(imageMenuData,opertionn);
}
});
});
</script>
<style type="text/css">
</style>
</head>
<body>
<table id="table" class="table table-striped table-bordered table-condensed">
<tr>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
</tr>
<tr>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
</tr> <tr>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
</tr> <tr>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
<td>测试jQuerySmartMenu</td>
</tr> </table> </body>
</html>

jQuery smartMenu右键自定义上下文菜单插件的更多相关文章

  1. 【jQuery】smartMenu右键自定义上下文菜单插件(似web QQ)

    (前端用重点整理博客地址)链接地址:http://www.cnblogs.com/atree/archive/2011/06/30/jQuery-smartMenu-javascript.html 一 ...

  2. Mint linux 自定义上下文菜单实现ZIP压缩文件无乱码解压

    1. 前提条件 我的Mint Linux 是Thunar文件管理器(默认的). 2. 配置自定义动作 打开Thunar文件管理器,点击菜单“编辑”=>“配置自定义动作”.点击“+”添加一个新的. ...

  3. 自定义上下文菜单,contextmenu事件

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. .NET混合开发解决方案13 自定义WebView2中的上下文菜单

    系列目录     [已更新最新开发文章,点击查看详细] WebView2控件应用详解系列博客 .NET桌面程序集成Web网页开发的十种解决方案 .NET混合开发解决方案1 WebView2简介 .NE ...

  5. 如何添加“在这里打开PowerShell”到Windows中的上下文菜单

    It was only a matter of time, right? Due to my recent infatuation passionate love affair with PowerS ...

  6. Vue2的右键弹出菜单(vue-contextmenu)

    给大家推荐一个基于Vue2的右键弹出菜单插件,支持单一SPA页面以及可以在循环绑定中使用. 项目地址为:https://github.com/chIIC/vue-...demo1: 父组件绑定右键事件 ...

  7. 几款jQuery右键菜单插件介绍

    在网页中使用自定义右键菜单,实现上皆为使用javascript禁用浏览器默认的右键菜单,然后在网页中响应鼠标右键事件,弹出自定义的菜单. 类似右键菜单的组件网上很多.一般而言,改变浏览器的默认菜单应当 ...

  8. vue 右键菜单插件 简单、可扩展、样式自定义的右键菜单

    今天分享的不是技术,今天给大家分享个插件,针对现有的vue右键菜单插件,大多数都是需要使用插件本身自定义的标签,很多地方不方便,可扩展性也很低,所以我决定写了一款自定义指令调用右键菜单(vuerigh ...

  9. js进阶 12-18 jquery如何实现自定义右键菜单(把问题分细)

    js进阶 12-18  jquery如何实现自定义右键菜单(把问题分细) 一.总结 一句话总结:用鼠标右键事件contextmenu,阻止系统默认事件,让做好的右键菜单显示出来,并且显示在我们出现的位 ...

随机推荐

  1. 解决不同操作系统下git换行符一致性问题

    一.不同操系统下的换行符CR回车 LF换行Windows/Dos CRLF \r\nLinux/Unix LF \nMacOS CR \r二.解决方法 打卡git bash,设置core.autocr ...

  2. android 基础03 -- Intent

    Android 中的 Intent 是将要执行的操作的一种抽象的描述,是一个用于Android 各个组件之间传递消息的对象. Intent 的基本用法 Intent 基本的使用方法主要有三种: 启动一 ...

  3. ADO.NET复习总结(6)-断开式数据操作

    一.基础知识 主要类及成员(和数据库无关的)(1)类DataSet:数据集,对应着库,属性Tables表示所有的表(2)类DataTable:数据表,对应着表,属性Rows表示所有的行(3)类Data ...

  4. 一句话 Servlet

    Servlet是用来完成B/S架构下,客户端请求的响应处理. web.xml其实就是servlet的一个配置文件,通过他来寻找对应的servlet

  5. pip install在Windows下报错解决

    报错: Traceback (most recent call last): File, in<module> load_entry_point('pip==1.4.1','console ...

  6. Insert Sort Singly List

    对单链表插入排序,给出个单链表的head节点:返回排完序的head节点: 首先数据结构中习惯了以数组为参数排序,瞬间想到是遍历单链表存入arraylist中,再进行insert sort,(O(n** ...

  7. Java compiler level does not match the version of the installed java project facet错误的解决

    因工作的关系,Eclipse开发的Java项目拷来拷去,有时候会报一个很奇怪的错误.明明源码一模一样,为什么项目复制到另一台机器上,就会报“java compiler level does not m ...

  8. start tomcat with debugging mode

    For this, you must run your application in debug mode, which requires below parameters. -Xdebug -Xru ...

  9. margin 和 padding 的本质区别

    问题? 如何弄清 margin 和 padding之间的区别? 那,答案呢? margin 边界, padding 填充 假如有一个盒子,padding就相当于盒子的厚度,盒子大小固定,通过修改pad ...

  10. 输入和输出--java的NIO

    Java的NIO 实际开发中NIO使用到的并不多,我并不是说NIO使用情景不多,是说我自己接触的并不是很多,前面我在博客园和CSDN上转载了2篇别人写的文章,这里来大致总结下Java的NIO,大概了解 ...