Joe Auty![]()
Menu navigation which utilizes YUI 3 Transitions for smooth and responsive feedback, mouseenter/mouseleave for simple event triggering for when menus should be shown/hidden, and custom Javascript triggers to invoke your own functions when certain menu items are selected
See https://github.com/joeauty/NetMusician-Menu-Nav-YUI-Widget/blob/master/README.md
<script src="http://yui.yahooapis.com/3.10.0/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2013.05.02-22-59'
}).use('gallery-nmmenus', 'event-delegate', function(Y) {
var config = {
anim:'blind',
ajaxLoadFunc:Y.bind(ajaxLoadFunc),
pulses:2,
pulseduration:0.3
}
var nmmenu = new Y.NMMenus(config);
function ajaxLoadFunc(nmmenu) {
Y.all('#' + nmmenu.get('menudivid') + ' li a.topLink').each(function(node) {
node = node.get('parentNode');
Y.delegate('click', function(e) {
if (this.get('href').match(/#$/) && this.hasClass('topLink')) {
// cancel click
e.preventDefault();
return;
}
else if (Y.one('#' + this.get('id')).hasClass('noajax')) {
// abort, but do not cancel click
return;
}
e.preventDefault();
if (this.hasClass('topLink')) {
// top level link, do not init pulsate
ajaxLoadTrigger({
page:this.get('pathname'),
id:this.get('id')
})
}
else {
nmmenu.menuItemPulsate(this.get('id'), ajaxLoadTrigger, {
page:this.get('pathname'),
id:this.get('id')
});
}
}, node, 'a');
});
}
function ajaxLoadTrigger(configObj) {
switch (configObj.id) {
case 'menu_JohnColtrane':
//alert('do Coltrane thing');
break;
case 'menu_MilesDavis':
alert('do Miles Davis thing');
break;
default:
window.location.href = configObj.page;
break;
}
}
});No forum posts for this module.
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info