jquery overlay loading bar div

后端 未结 4 498
清酒与你
清酒与你 2021-01-31 05:09

So I have a table of data, and I\'m getting data back using ajax. When data is being retrieved, the data from the table disappears and a small little loading circle appears. I\'

4条回答
  •  渐次进展
    2021-01-31 05:53

    just use jQuery's .html() method to inject the new div with loading circle into the div holding the table. Then use css to style it. maybe give it a background image that is opaque. and relatively or absolutely position the loading circle.

    say you have:

    loading
    ');

    and style it something like:

    #overlay {
        width: 100%;
        background: url('path/to/opaque/img.png') repeat;
        position: relative;
    }
    
    #overlay img.loading_circle {
        position: absolute;
        top: 50%;  // edit these values to give you
        left: 50%; // the positioning you're looking for.
    }
    

提交回复
热议问题