开发者

jQuery Ajax animation Chain

The Code

$.ajax({
    url: "get_portfolio_experience.php",
    success: function(html) {
        $("#inbox_content").html(html).hide().slideDown('slow');
    }
});

The content doesn't animate if i do not put a hide() before slideDown(). And if i put a开发者_StackOverflow社区 hide() it doesn't show in IE. What should i do?


First, let's shorten this down with .load() like this:

$("#inbox_content").load("get_portfolio_experience.php", function(html) {
  $(this).hide().slideDown('slow');
});

Now for the issues, your explanation of IE behaving weird is almost certainly caused by invalid markup. Check the response coming back, are there any unclosed or invalid tags? Check it with the W3C Validator here: http://validator.w3.org/


You should add a CSS style display: none; for #inbox_content and use this code:

$.ajax({ 
    url: "get_portfolio_experience.php", 
    success: function(html) {
        $("#inbox_content").html(html).slideToggle('slow'); 
    } 
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜