Getting the browser cursor from “wait” to “auto” without the user moving the mouse

前端 未结 15 1994
自闭症患者
自闭症患者 2020-11-27 13:49

I use this jQuery code to set the mouse pointer to its busy state (hourglass) during an Ajax call...

$(\'body\').css(\'cursor\', \'wait\');

15条回答
  •  [愿得一人]
    2020-11-27 13:58

    HERE is my solution:

    function yourFunc(){
    
    $('body').removeClass('wait'); // this is my wait class on body you can $('body').css('cursor','auto');
    $('body').blur();
    $('body').focus(function(e){
    $('body')
     .mouseXPos(e.pageX + 1)
     .mouseYPos(e.pageX - 1);
    });
    
    }
    

提交回复
热议问题