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

前端 未结 15 2000
自闭症患者
自闭症患者 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

    I haven't tried this, but what about if you create a transparent div that is absolutely positioned and fills the viewport just before changing the CSS. Then, when the css is changed on the body, remove the div. This might trigger a mouseover event on the body, which might cause the cursor to update to the latest CSS value.

    Again, I haven't tested this, but it's worth a shot.

提交回复
热议问题