js data loading loading package

<!-- 模态框(Modal) -->
<div class="modal fade" id="qst_loading" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="z-index: 9999">
    <div class="modal-dialog">
        <div class="modal-content" style="width: 0px; text-align: center">
            <div class="modal-body" >
            </div>
        </div><!-- /.modal-content -->
        {{ image("static/background/image/loading.gif", "alt":"loading", "style":"max-width: 200px; margin:200px 100px 100px 200px") }}
    </div><!-- /.modal-dialog -->
</div>
<!-- /.modal -->
/*
* 1. This encapsulation outer layer wraps a self-executing function, as long as this file is introduced, js will automatically execute
* 2. if('undefined' == typeof QstLoading) First judge whether the QstLoading function name is used, and avoid overwriting other methods
* 3. Define an anonymous function, use the new constructor, which means to create a new object QstLoading, and assign a new address, change this to point to QstLoading, (this)
* 4. Add properties show and hide for new objects
* 5. QstLoading is not declared and becomes a global object (this method is not recommended to become global)
*/



/*
* 1. This encapsulation outer layer wraps a self-executing function, as long as this file is introduced, js will automatically execute
* 2. if('undefined' == typeof QstLoading) First judge whether the QstLoading function name is used, and avoid overwriting other methods
* 3. Define an anonymous function, use the new constructor, which means to create a new object QstLoading, and assign a new address, change this to point to QstLoading, (this)
* 4. Add properties show and hide for new objects
* 5. QstLoading is not declared and becomes a global object (this method is not recommended to become global)
*/
$(function() {
        if('undefined' == typeof QstLoading){
            QstLoading = new function () {
                var _modal = $('#qst_loading');
                $(_modal).modal({
                    keyboard: false,
                    backdrop: 'static',
                    show: false
                });
                this.show = function () {
                    $(_modal).modal("show");
                };
                this.hide = function () {
                    $(_modal).modal('hide');
                }
            }();
        }
    });

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324751940&siteId=291194637