jQuery slideDown with easing

后端 未结 5 497
小鲜肉
小鲜肉 2021-02-08 00:18

How can use the slideDown() function with easing?

Maybe extend it somehow?

I\'m looking for something like this:

jQuery.fn.slideDown = function(s         


        
相关标签:
5条回答
  • 2021-02-08 00:36

    You can use the animate method with jQueryUI and the easing effects like this:

    $(".demo").animate({height: "hide"}, 1500, "easeInQuad", function(){});
    
    0 讨论(0)
  • 2021-02-08 00:43

    Have a look at my pen Demo you simple to use $(element).slideUp({duration:1000});

    0 讨论(0)
  • Easing In and Out:

                $("#SignIn").click(function () {
    
                    $(".divSlideTop").slideDown({
                        duration: 1000,
                        easing: "easeInQuad"
                    });
                });
    
                $("#close").click(function () {
    
                    $(".divSlideTop").slideUp({
                        duration: 1000,
                        easing: "easeOutQuad"
                    });
                });
    
    0 讨论(0)
  • 2021-02-08 00:56

    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});
    
    0 讨论(0)
  • 2021-02-08 00:57
    $('.class').slideDown(400,'easeInQuad');
    

    Quotes not need for numeric.

    0 讨论(0)
提交回复
热议问题