SlwUi(Super Lightweight UI)前端js插件菜单系列(3)右键菜单SlwCtxMenu,导航菜单SlwMenu

      今天介绍前端js插件菜单系列(3)右键菜单SlwCtxMenu,导航菜单SlwMenu。

基于jQuery,浏览器兼容(Browser Support)

  • Internet Explorer:  7, 8, 9, 10, 11
  • Chrome
  • Edge
  • Firefox
  • Safari
  • Opera

1、右键菜单SlwCtxMenu

var callbackFun = {
	'copy' : function(li) {
		alert('copy');
	},
	'cut' : function(li) {
		alert('cut');
	},
	'del' : function(li) {
		alert('del');
	},
	'paste' : function(li) {
		alert('paste');
	}
};
$('#menuDiv1').slwCtxMenu('menu1', {
	init : function(el, menu) {
		menu.find('[rel=paste]').hide();
	},
	callback : callbackFun
});

 

源码:https://github.com/wang-weidong/SlwCtxMenu

Demo: https://wang-weidong.github.io/SlwCtxMenu/demo/index.html

2、导航菜单SlwMenu

(1)基于Html标签渲染

(2)基于Ajax请求json数据渲染

SlwUi(Super Lightweight UI)前端js插件菜单系列(3)右键菜单SlwCtxMenu,导航菜单SlwMenu

代码:https://github.com/wang-weidong/SlwMenu

emo: https://wang-weidong.github.io/SlwMenu/demo/index.html