Jquery Stop Fadein / Fadeout

后端 未结 5 868
走了就别回头了
走了就别回头了 2020-12-08 08:00

This is a fairly easy one, but I cant seem to figure it out.

Basically I have a jquery hover that fades in a div and fades out the other upon hover.

When I

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 08:24

    Thought I would post this because none of these answers worked for me.

    *The true params tell stop to clear the queue and go to the end of the animation

    $(".txtWrap").stop().hover(
      function () {
        $(this).find('.txtBock').stop(true, true).fadeOut();
        $(this).find('.txtDesc').fadeIn();
    
      },
      function () {
        $(this).find('.txtBock').fadeIn();
        $(this).find('.txtDesc').stop(true, true).fadeOut();
      }
    )
    

    Link: http://forum.jquery.com/topic/jquery-hover-events-cant-keep-up-with-fadein-and-fadeout-events-queue

提交回复
热议问题