How to change cursor to wait when using jQuery .load()

后端 未结 8 615
孤街浪徒
孤街浪徒 2020-12-08 13:35

While waiting for a response from a .load(), is there any way to change the cursor to the busy/wait cursor?

8条回答
  •  自闭症患者
    2020-12-08 13:47

    I had to tweak the eloquent answer above to work with jQuery > 1.8.

    $(document).ajaxStart(function () {
        $(document.body).css({ 'cursor': 'wait' })
    });
    $(document).ajaxComplete(function () {
        $(document.body).css({ 'cursor': 'default' })
    });
    

提交回复
热议问题