Delay CSS function in Jquery?

后端 未结 8 1255
自闭症患者
自闭症患者 2021-02-13 11:12

How can I delay a CSS change in jquery? Here is my code:

$(\"document\").ready(function() {
    $(\".pressimage img\").mouseenter(function() {
        $jq(this)         


        
8条回答
  •  一向
    一向 (楼主)
    2021-02-13 11:32

    Try this:

    $(".pressimage img").mouseleave( function(){
        var that = this;
        setTimeout( function(){
          $(that).css('z-index','1');
        },500);
     });
    

提交回复
热议问题