-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathtest.html
119 lines (110 loc) · 2.46 KB
/
test.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta charset="UTF-8">
<title>消息定向分享</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, target-densitydpi=medium-dpi" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- <link href="css/main.css" rel="stylesheet" type="text/css" /> -->
<style type="text/css">
body {
font:1em/1.5em 'Verdana', 'Arial', sans-serif;
}
img {
width:400px;
}
#w{
/* background: url('Koala.jpg');
display: none;*/
}
@media screen and (max-width:800px) {
body {
background: red;
font-size:0.8em;
}
img {
width:300px;
}
}
@media screen and (max-width:400px) {
body {
background: red;
font-size:0.7em;
}
img {
width:200px;
}
}
body, img {
transition:all 2s linear;
-o-transition:all 2s linear;
-moz-transition:all 2s linear;
-webkit-transition:all 2s linear;
}
</style>
</head>
<body>
<div class="main">
<div id="w">123123</div>
<div id="p">
<ul>
<li>
<ul id="e">
<li class="r"></li>
</ul>
</li>
<li>
<ul>
<li class="r"></li>
</ul>
</li>
<li>
<ul>
<li class="r"></li>
</ul>
</li>
<li>
<ul>
<li class="r"></li>
</ul>
</li>
</ul>
</div>
</div>
</body>
<script type="text/javascript" src="js/JM.js"></script>
<script type="text/javascript">
var $D = JM.dom;
var t = $D.id("e");
console.log($D.$("li",t));
// document.getElementById("w").onclick=function(){
// var self = this;
// self.className = "";
// // setTimeout(function(){
// self.className = "w";
// // },0);
// }
//采用innerHTML方式创建
var t1 = Date.now();
// var str= "";
// for(var i = 0; i < 1000; i++){
// str += "<a>"+i+"</a>";
// }
// document.querySelector("#xyz").innerHTML = str;
//执行时间为22秒
//采用DOM节点对象操作的方式创建
// var c = document.querySelector("#xyz"), anchor;
// for(var i = 0; i < 1000; i++){
// anchor = document.createElement("a");
// anchor.textContent = i;
// c.appendChild(anchor);
// }
// console.log(Date.now()-t1);
//执行时间为14秒
JM.event.on(document.getElementById("w"),"tap",function(){
alert("o");
});
</script>
</html>