-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.html
31 lines (31 loc) · 1.29 KB
/
demo.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width initial-scale=1 minimum-scale=1 maximum-scale=1 user-scalable=no">
<title>Demo</title>
</head>
<body>
显示文字:<input type="text" id="title" placeholder="加载中..." value="加载中..." >
加载时间:<input type="text" id="duration" placeholder="loading显示时间" value="1500" >
图标类型:<label><input type="radio" name="icon" value="success">success</label>
<label><input type="radio" name="icon" value="error">error</label>
<label><input type="radio" name="icon" value="loading" checked>loading</label>
<label><input type="radio" name="icon" value="none">none</label>
<button onclick="showToast()">显示loading</button>
<button onclick="hideLoading()">隐藏loading</button>
</body>
<script src="https://cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="jquery.toast.js"></script>
<script>
function showToast(){
var title = $("#title").val();
var icon = $('input[name="icon"]:checked').val();
var duration = $("#duration").val()*1;
$.Toast.showToast({title: title,duration: duration, icon:icon,image: ''});
}
function hideLoading(){
$.Toast.hideToast();
}
</script>
</html>