-
Notifications
You must be signed in to change notification settings - Fork 4
/
child.html
46 lines (43 loc) · 1.29 KB
/
child.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>子页测试</title>
<style>
.btn {
margin: 20px;
width: 160px;
height: 40px;
line-height: 40px;
font-size: 16px;
color: white;
background-color: #2D93CA;
border-radius: 3px;
transition: all 0.5s;
cursor: pointer;
text-align: center;
}
.btn:hover {
background-color: #256d95;
}
</style>
</head>
<body>
<div class="btn" onclick="f1()">子页给父页发消息</div>
<div class="btn" onclick="f2()">子页打开子窗口</div>
<div class="btn" onclick="f3()">关闭子页</div>
</body>
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="./js/mac.child.min.js"></script>
<script>
function f1() {
Macui_child.newMsg('子页的问候', '这是从iframe页调用APi发送的消息哦');
}
function f2() {
Macui_child.openUrl('http://win10ui.yuri2.cn', '<img class=\'icon\' src=\'./img/icon/mac.png\'/>', 'Macui-UI官网')
}
function f3() {
Macui_child.close();
}
</script>
</html>