jquery fade and slide simultaneously

前端 未结 3 810
囚心锁ツ
囚心锁ツ 2020-12-04 21:38

I\'m trying to both slide/fade a div simultaneously on a hover, then slide/fade it out at the end of the hover, using JQuery. The slide/fade out work properly, but the slide

3条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 22:28

    idk if this helps or not, but you can skip the slideUp and fadeIn shortcuts and just use animate:

    http://jsfiddle.net/bZXjv/

    $('#anotherDiv').hover(function() {
        $('#myDiv')
            .stop(true, true)
            .animate({
                height:"toggle",
                opacity:"toggle"
            },slideDuration);
    });
    

提交回复
热议问题