Okay, So i have a nice menu which shows and hides divs to change the page content.
however If I click on a multiple menu items quickly, I get a stacking up of divs, or multiple divs showing themselves in the window.
I'm trying to implement a kind of delay so an effect must take place only when the one proceeding it has finished. But its probing very tricky.
Here is the source of it so far.
Code:
var showFunction = function(e) {
$$('.hidden').setStyles({
'visibility': 'hidden',
'opacity': 0
});
this.start({'visibility': 'visible','opacity': 1 });
}
var contentHome = $('Content-Home');
var contentAbout = $('Content-About');
var contentContact= $('Content-Contact');
contentHome = new Fx.Morph(contentHome, { link: 'chain' });
contentAbout = new Fx.Morph(contentAbout, {link: 'chain' });
contentContact = new Fx.Morph(contentContact, {link: 'chain' });
$('Home').addEvent('click', showFunction.bind(contentHome));
$('About').addEvent('click', showFunction.bind(contentAbout));
$('Contact').addEvent('click', showFunction.bind(contentContact));