Alert.js
1.21 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* founder : zzf
* Creation time : 2015/2/25
* note :
* role :
*/
define(function( require, exports, module ) {
var config = {
time : 2000,//定时关闭
x : 0,//位置x坐标
y : 0,//位置y坐标
z : 0,//位置z深度
width : 300,//提示框宽度
height : 150,//提示框高度
view : $(".m-message")
};
exports.get = function(key){
if(! key){return false;}
for(i in config){
if(i === key){
return config[i];
}
}
return false;
};
exports.set = function(Object){
if("object" !== typeof(Object)){return false;}
var isSucceed = false;
for(i in config){
for(k in Object){
if(i === k){
config[i] = Object[k];
isSucceed = true;
}
}
}
return isSucceed;
};
exports.show = function(txt){
config.view.find("span").html(txt);
config.view.removeClass("m-animate-hide");
var Time = setTimeout(function(){
clearTimeout(Time);
config.view.addClass("m-animate-hide");
}, config.time);
}
});