I
I
Igor2018-02-17 03:38:21
JavaScript
Igor, 2018-02-17 03:38:21

How to make Fade during slideUp and slideDown?

How to make Fade in this situation, I tried it through animate, it did not work, what are the options ??

$(".items .item").click(function() {
  $(".items .item").removeClass("active").eq($(this).index()).addClass('active');
  $(".hidden-block .item-content").slideUp().eq($(this).index()).slideDown();
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
y0u, 2018-02-17
@xandri

$.fn.slideFadeToggle = function(speed, easing, callback) {
    return this.animate({
            opacity: 'toggle',
            height: 'toggle'
        },
        speed, easing, callback);
};

$("button").click(function() {
    $('.content').slideFadeToggle(800);
});

https://jsfiddle.net/y0u/59fso3ct/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question