jQuery鼠標左右鍵菜單代碼



56 220 74



特效描述:jQuery 鼠標左右鍵菜單,jQuery鼠標左右鍵菜單代碼

代碼結構

1. 引入CSS

<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" href="http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link rel="stylesheet" type="text/css" href="css/zzsc.css">
<link rel="stylesheet" href="dist/basicContext.min.css">
<link rel="stylesheet" href="dist/themes/default.min.css">

2. 引入JS

<script src="dist/basicContext.min.js"></script>

3. HTML代碼

	<div class="htmleaf-container">
		<header class="htmleaf-header">
			<div class="zzsc center">
			  <a href="index.html" class="current">default</a>
			  <a href="index2.html">position</a>
			  <a href="index3.html">scroll</a>
			  <a href="index4.html">closeFunction</a>
			  <a href="index5.html">customPosition</a>
			  <a href="index6.html">jQuery</a>
			</div>
		</header>
		<div class="htmleaf-content">
			<a href="#" class="click">鼠標左鍵點擊我</a>
			<a href="#" class="context">鼠標右鍵點擊我</a>
			<a href="#" class="touchend">Touch me! (移動手機有效)</a>
		</div>
	</div>
	<script>
		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)
		})
	</script>



用戶評論
大牛,別默默的看了,快登錄幫我點評一下吧!:)      登錄 | 注冊


熱門標簽: 彈出層拖動 窗口 彈出 彈窗 彈出層 提示框 對話框 遮罩 遮罩層 彈窗插件 右鍵菜單
?
×
×

注冊

官方QQ群

掃描上面二維碼加微信群

官方QQ群

jQuery/js討論群
群號:642649996
Css3+Html5討論群
群號:322131262

加群請備注:從官網了解到

老夫子电子