-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.html
54 lines (45 loc) · 1.68 KB
/
model.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
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<title></title>
<link href="css/bootstrap.min.css"/>
<style>
body {
background-color: red;
}
</style>
<script src="js/fastclick.js"></script>
<script>
if ('addEventListener' in document) {
document.addEventListener('DOMContentLoaded', function() {
FastClick.attach(document.body);
}, false);
}
</script>
</head>
<body>
<div id="docuemnt-body" style="position: fixed;left:0;top:0;width: 100%;height: 100%;display: none"></div>
<div id="ppp">中文</div>
创建新的Webview窗口<br/>
<button id='bbt' >Create</button>
<button id="showall">显示所有</button>
<script type="text/javascript">
document.addEventListener('plusready', function () {
//console.log("所有plus api都应该在此事件发生后调用,否则会出现plus is undefined。"
document.getElementById('showall').addEventListener('click', function () {
console.log('hi');
document.getElementById('ppp').textContent = plus.webview.all().length;
});
document.getElementById('bbt').addEventListener('click', function(){
//创建一个窗口,但是此时不是显示的。
var webviews = plus.webview.create('test.html', 'hello');
//通过show()方法讲此窗口显示,支持动画,速率
plus.webview.show( webviews ,'fade-in',600); // 显示窗口
//若要关闭he.html窗口,可以在he.html中设置,关闭
})
});
</script>
</body>
</html>