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.
精彩评论