自定义多层级连网页右键

XML/HTML Code
- <div id="download">Right Click to Demo <span class="amp">&</span> Download</div>
JavaScript Code
- $(document).ready(function(){
- context.init({preventDoubleContext: false});
- context.attach('.inline-menu', [
- {header: 'Options'},
- {text: 'Open', href: '#'},
- {text: 'Open in new Window', href: '#'},
- {divider: true},
- {text: 'Copy', href: '#'},
- {text: 'Dafuq!?', href: '#'}
- ]);
- context.attach('#download', [
- {header: 'Download'},
- {text: 'The Script', subMenu: [
- {header: 'Requires jQuery'},
- {text: 'context.js', href: '#', target:'_blank', action: function(e){
- _gaq.push(['_trackEvent', 'ContextJS Download', this.pathname, this.innerHTML]);
- }}
- ]},
- {text: 'The Styles', subMenu: [
- {text: 'context.bootstrap.css', href: '#', target:'_blank', action: function(e){
- _gaq.push(['_trackEvent', 'ContextJS Bootstrap CSS Download', this.pathname, this.innerHTML]);
- }},
- {text: 'context.standalone.css', href: '#', target:'_blank', action: function(e){
- _gaq.push(['_trackEvent', 'ContextJS Standalone CSS Download', this.pathname, this.innerHTML]);
- }}
- ]},
- {divider: true},
- {header: 'Meta'},
- {text: 'The Author', subMenu: [
- {header: '@freejs'},
- {text: 'Website', href: 'http://www.freejs.net/', target: '_blank'},
- {text: 'freejs', href: 'http://www.freejs.net', target: '_blank'},
- {text: 'Donate?', action: function(e){
- e.preventDefault();
- $('#donate').submit();
- }}
- ]},
- {text: 'Hmm?', subMenu: [
- {header: 'Well, thats lovely.'},
- {text: '2nd Level', subMenu: [
- {header: 'You like?'},
- {text: '3rd Level!?', subMenu: [
- {header: 'Of course you do'},
- {text: 'MENUCEPTION', subMenu: [
- {header:'FUCK'},
- {text: 'MAKE IT STOP!', subMenu: [
- {header: 'NEVAH!'},
- {text: 'Shieeet', subMenu: [
- {header: 'WIN'},
- {text: 'Dont Click Me', href: 'http://freejs.net/', target:'_blank', action: function(){
- _gaq.push(['_trackEvent', 'ContextJS Weezy Click', this.pathname, this.innerHTML]);
- }}
- ]}
- ]}
- ]}
- ]}
- ]}
- ]}
- ]);
- context.settings({compress: true});
- context.attach('html', [
- {header: 'Compressed Menu'},
- {text: 'Back', href: '#'},
- {text: 'Reload', href: '#'},
- {divider: true},
- {text: 'Save As', href: '#'},
- {text: 'Print', href: '#'},
- {text: 'View Page Source', href: '#'},
- {text: 'View Page Info', href: '#'},
- {divider: true},
- {text: 'Inspect Element', href: '#'},
- {divider: true},
- {text: 'Disable This Menu', action: function(e){
- e.preventDefault();
- context.destroy('html');
- alert('html contextual menu destroyed!');
- }},
- {text: 'Donate?', action: function(e){
- e.preventDefault();
- $('#donate').submit();
- }}
- ]);
- $(document).on('mouseover', '.me-codesta', function(){
- $('.finale h1:first').css({opacity:0});
- $('.finale h1:last').css({opacity:1});
- });
- $(document).on('mouseout', '.me-codesta', function(){
- $('.finale h1:last').css({opacity:0});
- $('.finale h1:first').css({opacity:1});
- });
- });
原文地址:http://www.freejs.net/article_jquerywenzi_169.html
最近更新
- jQuery轮播图插件slider-...
- CSS3鼠标悬停图片遮罩层变形动画特...
- 响应式全屏手风琴菜单,同时支持垂直方...
- 分组select选择器,支持多选和单...
- jQuery时间日期选择器代码日历插...
- Select 选择器 可以清空的单选...
我爱薅羊毛
点击最多
广告赞助
相关文章
- jquery点击显示或隐藏内容,可以一次展开多个和...
- tooltips/弹出层/消息提示效果,支持点击与...
- jQuery幸运大转盘抽奖活动代码
- jquery来实现的添加商品和减少商品数量,用于购...
- jQuery手机端弹出层提示对话框
- php js实现拖动滑块完成拼图验证码