jQuery .delay() doesn't work

后端 未结 8 1079
暗喜
暗喜 2020-12-19 18:26

I\'ve the following JavaScript snippet:

$(\"#dashboard\").addClass(\"standby\").delay(3000).removeClass(\"standby\");
$(\".active\").removeClass(\"active\");         


        
8条回答
  •  情话喂你
    2020-12-19 18:50

    Seems like for what you are trying to do, you might want to take a look at CSS transitions:

    http://css-tricks.com/almanac/properties/t/transition/

    You can still have .addClass(), except now your class will utilize these transition properties, and you won't need .delay().

提交回复
热议问题