How can use the slideDown() function with easing?
Maybe extend it somehow?
I'm looking for something like this:
jQuery.fn.slideDown = function(speed, easing, callback) {
return ...
};
So i can use it slide this
$('.class').slideDown('400','easeInQuad');
or this
$('.class').slideDown('400','easeInQuad',function(){
//callback
});
The slideDown() Method in jQuery is used to check the visibility of selected elements or to show the hidden elements. It works on two types of hidden elements: Elements hidden using jQuery methods. Elements hidden using display: none in CSS.
The slideToggle() method toggles between slideUp() and slideDown() for the selected elements. This method checks the selected elements for visibility. slideDown() is run if an element is hidden. slideUp() is run if an element is visible - This creates a toggle effect.
The jQuery slideDown() method is used to slide down an element. Syntax: $(selector).slideDown(speed,callback);
jQuery Animations - The animate() Method The jQuery animate() method is used to create custom animations. Syntax: $(selector).animate({params},speed,callback); The required params parameter defines the CSS properties to be animated.
You can use the animate method with jQueryUI and the easing effects like this:
$(".demo").animate({height: "hide"}, 1500, "easeInQuad", function(){});
Take a look at this page, which contains many easing functions: http://gsgd.co.uk/sandbox/jquery/easing/
Using that plugin you can do things like:
$(element).slideUp({
duration: 1000,
easing: method,
complete: callback});
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