Wait cursor over entire html page

后端 未结 14 1344
离开以前
离开以前 2020-12-02 14:19

Is it possible to set the cursor to \'wait\' on the entire html page in a simple way? The idea is to show the user that something is going on while an ajax call is being com

14条回答
  •  佛祖请我去吃肉
    2020-12-02 14:31

    I understand you may not have control over this, but you might instead go for a "masking" div that covers the entire body with a z-index higher than 1. The center part of the div could contain a loading message if you like.

    Then, you can set the cursor to wait on the div and don't have to worry about links as they are "under" your masking div. Here's some example CSS for the "masking div":

    body { height: 100%; }
    div#mask { cursor: wait; z-index: 999; height: 100%; width: 100%; }
    

提交回复
热议问题