14/12/2009
window.addEvent(‘domready’, function(){ $$($(‘nav’).getElements(‘.parent’).addEvent(‘click’, function() { this.fireEvent(‘open’); }).getNext(‘ul > li’)).set(‘reveal’, { transitionOpacity: false, link: ‘cancel’ }).hide(); $$(‘#nav .menu-item a’, ‘#nav .parent’).addEvents({ ‘verde’: function() {this.getParents(‘li.menu-item’).fireEvent(‘verde’);}, ‘bege’: function() {this.getParents(‘li.menu-item’).fireEvent(‘bege’);}, ‘open’: function() { var todos = $(‘nav’).getElements(‘ul.submenu’); var filho = this.getNext(‘ul.submenu’); var pais = $$(this.getParents(‘ul.submenu’)); var manter = $$([pais, filho].flatten()); $$($(‘nav’).getElements(‘a.active’).fireEvent(‘bege’).getParents(‘li.menu-item’)).fireEvent(‘bege’); todos.filter(function (el) { var flg = true; manter.each(function […]
window.addEvent(‘domready’, function(){
$$($(‘nav’).getElements(‘.parent’).addEvent(‘click’, function() {
this.fireEvent(‘open’);
}).getNext(‘ul > li’)).set(‘reveal’, {
transitionOpacity: false,
link: ‘cancel’
}).hide();
$$(‘#nav .menu-item a’, ‘#nav .parent’).addEvents({
‘verde’: function() {this.getParents(‘li.menu-item’).fireEvent(‘verde’);},
‘bege’: function() {this.getParents(‘li.menu-item’).fireEvent(‘bege’);},
‘open’: function() {
var todos = $(‘nav’).getElements(‘ul.submenu’);
var filho = this.getNext(‘ul.submenu’);
var pais = $$(this.getParents(‘ul.submenu’));
var manter = $$([pais, filho].flatten());
$$($(‘nav’).getElements(‘a.active’).fireEvent(‘bege’).getParents(‘li.menu-item’)).fireEvent(‘bege’);
todos.filter(function (el) {
var flg = true;
manter.each(function (m) {
if (m == el) {
flg = false;
manter.erase(m);
}
});
return flg && el.isVisible();
}).dissolve();
pais.reveal();
if (filho)
filho.isVisible() ? filho.dissolve() : filho.reveal();
this.fireEvent(‘verde’);
}
});
$$(‘#nav .menu-item a’, ‘#nav .parent’).addEvents({
‘verde’: function() {
if (!this.hasClass(‘verde’))
this.morph(‘.verde’).swapClass(‘bege’, ‘verde’);
},
‘bege’: function() {
if (!this.hasClass(‘bege’))
this.morph(‘.bege’).swapClass(‘verde’, ‘bege’);
},
‘mouseover’: function() {this.fireEvent(‘verde’);},
‘mouseout’: function() {this.fireEvent(‘bege’);}
});
$(‘nav’).getElements(‘li .active’).fireEvent(‘open’);
});