开发者

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

开发者 https://www.devze.com 2023-02-21 03:44 出处:网络
Intro, I\'m trying to write a new fun开发者_StackOverflow社区ction to load content using the slideDown() effect from Jquery

Intro,

I'm trying to write a new fun开发者_StackOverflow社区ction 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 !


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消