I want to slide + fade an element in, when I try doing
$("ul", this).fadeIn(300).slideDown(600);
I just get the fadeIn, how can I fade while slide an element in?
You can use animation for this
$("ul").animate({
"height": "toggle", "opacity": "toggle"
}, "slow");
this will slide down then fade in
insert this function somewheres
jQuery.fn.doubleHide = function(){
return $(this).hide().css('opacity', '0');
}
jQuery.fn.slideFade = function(slide, fade){
return $(this).slideDown(slide, function () {
$(this).fadeTo(fade, 100);
});
}
then u can call this function like the fadeIn()
$(this).stop(true).doubleHide().slideFade(400, 2000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With