Abort any actions if one is already running:
var running = 0
function createSpecialEffects() {
if(running==1) {
return
}
// Cache needed elements
elms = $$('div#products_new ul li a img');
elms.each(function(slink) {
slink.observe('mouseover', function(e) {
running=1
this.elm = Event.element(e);
this.elm_array = new Array();
this.elm_array = elms.without(this.elm);
this.elm_array.each(function(elms) {
elms.fade({
duration: 0.5,
to: 0.3,
scope: 'specials',
limit: '1',
afterFinish:function()
{running=0}
});
});
});
slink.observe('mouseout', function(e) {
running=1
this.elm_array.each(function(elms) {
elms.appear({
duration: 0.5,
to: 1.0,
scope: 'specials',
limit: '1'
afterFinish:function()
{running=0}
});
});
});
});
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---