开发者

How to change the cursor to default on loading

I have the following code to change the cursor when a hyperlink is clicked

        $('a').click(function () {
            $('*').css("cursor", "progress开发者_如何学JAVA");
        });

When a link is clicked, the cursor changes to "progress" (i.e. wait cursor) exactly as expected. However, the problem is that the cursor remains "progress" after a new page is loaded. It changes to default only after the mouse moves. This is related to another question. Others expressed the same problem.

As described by the title, I hope to change the cursor to default when a page is loaded.


You didn't clearly specify how it's meant to be used but here's an example of how to perform the behaviour you describe with an ajax call:

$('a').click(function () {
    $('body').css('cursor', 'progress');
    $.ajax({
      url: "test.html",
      context: document.body,
      complete: function(){
       $('body').css('cursor', 'default');
      }
    });
} );
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜