mirror of https://github.com/1099438829/macUI.git
46 lines
1.3 KiB
HTML
46 lines
1.3 KiB
HTML
<!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> |