Toni Michel Caubet
Toni Michel Caubet

Reputation: 20163

hide + load + slideDown(), can't see the effect

Intro,

I'm trying to write a new function to load content using the slideDown() effect from Jquery

This is the function, the content gets loaded properly, but i just don't see the Slide effect, i guess because it might be done before the content its loaded, so:

function load_something(nombre,tipo){
            $("#router").prepend(loader_image);
            $("#router").load('/includes/router.php?nombre='+encodeURI(nombre)+'&tipo='+tipo,function(){
                $("#router").slideDown(600); return false;
            });
}

Tried also:

$(div).hide().slideDown(time);

getting same result

Question,

What i am doing wrong?

Thank you !

Upvotes: 0

Views: 313

Answers (1)

linux4me
linux4me

Reputation: 875

Your code looks okay.

I think you need to start off with router hidden in order to see the effect. If you have an external style sheet add:

#router {display: none;}

so that the content is hidden until you execute your function, triggering the slidedown effect.

Upvotes: 1

Related Questions