Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
huangxin03 committed Aug 5, 2014
1 parent 646d2cf commit 09ae6db
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
sea-modules
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
sea-modules
.*.swp
._*
.DS_Store
Expand Down
1 change: 1 addition & 0 deletions .spmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
dist
src
touch.min.js
sea-modules
38 changes: 38 additions & 0 deletions test/test.html
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>

0 comments on commit 09ae6db

Please sign in to comment.