tags:

views:

69

answers:

1

Never worked with mootools and have this code. Instead on just injecting the content without effect, I'd like it to fade in but can't figure out how to add the fade('in') and make it work.

        onSuccess: function(text, xml) {
            new Element('div', {
                'html': text
            }).inject($(object), 'after');
            $(object).destroy();
        }
A: 
onSuccess: function(text, xml) {
    new Element('div', {
        'html': text,
        'styles': {
            'opacity': 0
        }
    }).inject($(object), 'after').fade('in');
    $(object).destroy();
}
Oskar Krawczyk