-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
huangxin03
committed
Aug 5, 2014
1 parent
646d2cf
commit 09ae6db
Showing
4 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
sea-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
sea-modules | ||
.*.swp | ||
._* | ||
.DS_Store | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
dist | ||
src | ||
touch.min.js | ||
sea-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Document</title> | ||
<style> | ||
h1 { | ||
font-family : "Microsoft Yahei"; | ||
cursor : pointer; | ||
text-align: center; | ||
margin-top: 3em; | ||
-webkit-user-select : none; | ||
} | ||
</style> | ||
<script src="../sea-modules/seajs/seajs/2.2.1/sea.js"></script> | ||
</head> | ||
<body> | ||
<h1 id="h1">Hold To Change Color</h1> | ||
<script> | ||
|
||
function getRandomColor() { | ||
var letters = '0123456789ABCDEF'.split(''); | ||
var color = '#'; | ||
for (var i = 0; i < 6; i++ ) { | ||
color += letters[Math.floor(Math.random() * 16)]; | ||
} | ||
return color; | ||
} | ||
|
||
seajs.use("../touch", function(touch){ | ||
touch.on("#h1", 'hold', function(){ | ||
this.style.color = getRandomColor(); | ||
}); | ||
}); | ||
|
||
</script> | ||
</body> | ||
</html> |