donakeiko
unread,Aug 26, 2008, 2:36:38 PM8/26/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MooTools Users
Guys,
I'm trying to add a simple effect to a div loaded with Request.HTML.
When the request is made, I want the div to fade out and only after
the response is completely loaded I want it to fade in. I came up with
this:
var menuSabores = $$('a.mini');
menuSabores.each(function(element) {
element.addEvent('click', function(event) {
event.stop();
embalagem.fade('out');
var req = new Request.HTML({
url: element.get('href'),
method: 'get',
update: embalagem,
onComplete: function() {
embalagem.fade('in');
},
onFailure: function() {
embalagem.set('text', 'Erro ao carregar o produto');
}
}).send();
$$('a.mini').removeClass('ativa');
element.addClass('ativa');
});
});
We see it fade out and then we see it loading, we can't see it fading
in. I tried with chain also but it didn't work as well. I think that
maybe the fade in must be chained after Complete event, but I don't
know how to write it.
could somebody help me please?
Thanks,
Cátia