Changing cursor to waiting in javascript/jquery

后端 未结 13 2040
孤街浪徒
孤街浪徒 2020-12-04 10:43

\"enter

How would i get my cursor to change to this loading icon when a function is ca

13条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 11:05

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

    This will create a loading cursor till your ajax call succeeds.

提交回复
热议问题