开发者

Which jQuery function is there to hide an element by making it transparent?

Which jQuery function is there to hide an element by making it transparent instead of dra开发者_如何学Pythonwing it out (which is provided in show/hide jQuery functions).


Just use $(selector).css('visibility', 'hidden');


jQuery.fadeOut ?


In addition to the other responses, if you want an animation, you can apply your own by using the animate() function. Then you can animate the css-property you want (with some limitations):

$('#foo').click(function(){
    $('#bar').animate({opacity: 0}, 5000, function(){
        // #bar is gone!
    });
});

jsFiddle example here.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜