Skip to content

Commit 09ae6db

Browse files
author
huangxin03
committed
test
1 parent 646d2cf commit 09ae6db

File tree

4 files changed

+41
-0
lines changed

4 files changed

+41
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules
2+
sea-modules

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules
2+
sea-modules
23
.*.swp
34
._*
45
.DS_Store

.spmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dist
22
src
33
touch.min.js
4+
sea-modules

test/test.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Document</title>
6+
<style>
7+
h1 {
8+
font-family : "Microsoft Yahei";
9+
cursor : pointer;
10+
text-align: center;
11+
margin-top: 3em;
12+
-webkit-user-select : none;
13+
}
14+
</style>
15+
<script src="../sea-modules/seajs/seajs/2.2.1/sea.js"></script>
16+
</head>
17+
<body>
18+
<h1 id="h1">Hold To Change Color</h1>
19+
<script>
20+
21+
function getRandomColor() {
22+
var letters = '0123456789ABCDEF'.split('');
23+
var color = '#';
24+
for (var i = 0; i < 6; i++ ) {
25+
color += letters[Math.floor(Math.random() * 16)];
26+
}
27+
return color;
28+
}
29+
30+
seajs.use("../touch", function(touch){
31+
touch.on("#h1", 'hold', function(){
32+
this.style.color = getRandomColor();
33+
});
34+
});
35+
36+
</script>
37+
</body>
38+
</html>

0 commit comments

Comments
 (0)