loading.js
720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/**
* Loading mask
* @author: xuqi<qi.xu@yoho.cn>
* @date: 2015/10/29
*/
var $ = require('yoho.zepto');
var $page = $('.yoho-page');
var $loading;
/**
* 初始化loading mask
* @param $container loading容器, position:relative
*/
function initLoadingMask() {
var html = '<div class="loading-mask hide"><div class="loading"></div></div>';
$page.append(html);
$loading = $page.children('.loading-mask');
}
//显示loading
function showLoadingMask() {
$loading.removeClass('hide');
}
//隐藏loading
function hideLoadingMask() {
$loading.addClass('hide');
}
exports.initLoadingMask = initLoadingMask;
exports.showLoadingMask = showLoadingMask;
exports.hideLoadingMask = hideLoadingMask;