开发者

How to fade in with jQuery

My idea is to fade in to the tab that is loaded.

This code seems like it should work, but it doesn't fade in. What is wrong?

$(document).ready(function() {
    $("#logo").click(function(event) {
        $("#central").fadeIn("slow").load('page.html');
    });
});开发者_如何学C


You have to hide #central first, before fading it in:

$('#central').hide().fadeIn('slow').load('page.html');


Jacob's answer is right, of course, but I'd hazard a guess that you probably want to load the html and then fade it in?

$(document).ready(function() {
    $("#logo").click(function(event) {
        $("#central").load('page.html', function() {
           $(this).fadeIn("slow");
        });
    });
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜