basicContext.js - 强大的纯Js上下文菜单插件

basicContext.js - 强大的纯Js上下文菜单插件
下载次数:2 文件大小:59.94KB 所需积分:0 QQ联系购买积分:3331653644(1元=10积分)
var onClick = function(e) {

	var clicked = function() { alert('Item clicked!') }

	var items = [
		{ title: 'Add Sites', icon: 'ion-plus-round', fn: clicked },
		{ title: 'Reset Login', icon: 'ion-person', fn: clicked },
		{ title: 'Help', icon: 'ion-help-buoy', fn: clicked },
		{ title: 'Disabled', icon: 'ion-minus-circled', fn: clicked, disabled: true },
		{ title: 'Invisible', icon: 'ion-eye-disabled', fn: clicked, visible: false },
		{ },
		{ title: 'Logout', icon: 'ion-log-out', fn: clicked }
	]

	basicContext.show(items, e)

}

document.addEventListener('DOMContentLoaded', function() {

	document.querySelector('a.click').addEventListener('click', onClick)
	document.querySelector('a.context').addEventListener('contextmenu', onClick)
	document.querySelector('a.touchend').addEventListener('touchend', onClick)

})

 

0 条评论