jQuery delay not working

后端 未结 3 718
孤城傲影
孤城傲影 2020-11-28 08:30
$(\'.transparent\').removeClass(\'transparent\').delay(2000).addClass(\'not_transparent\').delay(4000)

I have a div that is semi transparent and th

3条回答
  •  天涯浪人
    2020-11-28 08:56

    I know this is an old question, but there's still a lot of traffic coming here from google so I'll add my two cents;

    You could use something like -

    $('.transparent').fadeIn().delay(500).queue(function(){
      $('.transparent').addClass('yourclass');
    });

    You can pass a function to the queue in order to execute them after the delay. Have been using this myself for very similar examples.

提交回复
热议问题