Javascript - loading/busy indicator or transparent div over page on event click

后端 未结 5 2062
萌比男神i
萌比男神i 2020-12-09 06:45

i got a client side javascript function which is triggered on a button click (basically, its a calculator!!). Sometimes, due to enormous data on the page, the javascript cal

5条回答
  •  一向
    一向 (楼主)
    2020-12-09 06:50

    I would do something like:

    1. unhide a div (display:inline)
    2. make the position:absolute
    3. give it a z-index:99
    4. make the height and width 100%
    5. when the processing is done set display:none

    To make it transparent you'll have to set the opacity which is different in Firefox, IE, etc.

    To show a loading icon you can always create a second div and position it where you want to on the page. When it's done loading, remove it along with the transparent one.

提交回复
热议问题