How can I delay the start of a CSS animation?

后端 未结 3 1598
-上瘾入骨i
-上瘾入骨i 2020-12-10 06:45

I\'m trying to delay the trigger of a CSS animation (not slow down the animation itself, but delay it a few seconds before starting). And the image should not display before

3条回答
  •  孤街浪徒
    2020-12-10 07:05

    Add a settimeout function

    Hi there, you could add an event listen that get when you mouseover the certain element and then calls the function after 1 second.

    $('slideRight').on('mouseover',function(){
    
    window.setTimeout(function(){
        $this.addClass('onesecond');
    }, 1000); //<-- Delay in milliseconds
     });
    

提交回复
热议问题