Delay CSS function in Jquery?

后端 未结 8 1240
自闭症患者
自闭症患者 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:48
    $("document").ready(function() {
    $(".pressimage img").mouseenter(function() {
        $jq(this).css('z-index','1000');
            });
    $(".pressimage img").mouseleave(1000,function() {
        $jq(this).delay(500).css('z-index','1');
            });
    });
    

    Does this work? :)

    0 讨论(0)
  • 2021-02-13 11:52

    Try the following.

    jQuery.fn.extend({
        qcss: function(map){
            $(this).queue(function(next){ 
                $(this).css(map); 
                next(); 
            });
    
            return this;
        }
    });
    
    0 讨论(0)
提交回复
热议问题