Jquery delay() function

前端 未结 2 1709
一个人的身影
一个人的身影 2020-12-29 05:29

I have some jquery and am trying to apply a delay to it but can\'t seem to get it to work.

The current jquery is as follows...

image.css({\"visibilit         


        
2条回答
  •  粉色の甜心
    2020-12-29 06:14

    .delay() is not only for animations.

    It's for anything in a queue.

    image.delay(800)
         .queue(function( nxt ) {
             $(this).css({"visibility":"hidden"}).removeClass("image-background");
             nxt(); // continue the queue
         });
    

    For the down voter:

    HERE'S A DEMO

提交回复
热议问题