Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make touch-test change event to test

  • Loading branch information...
commit 98443552a4d33da688f4427cdc218a5227bbacaa 1 parent 7467d8f
@bunhere authored
Showing with 20 additions and 12 deletions.
  1. +20 −12 test/touch-test.html
View
32 test/touch-test.html
@@ -102,7 +102,7 @@ <h1 id="title">touch 5 times</h1>
<h3 id="timer">00:00:00</h3>
<div>
<div id="play" class="button orange">start without effects</div>
- <div id="playWithEffects" class="button orange">start with effects</div>
+ <div id="playWithEffects" class="button orange">start<br> with effects</div>
</div>
<div class="touchpad">
<div class="ball"></div>
@@ -129,6 +129,25 @@ <h3 id="timer">00:00:00</h3>
events = "touchstart";
else
events = "mouseup";
+ var eventArr = ["touchstart", "touchmove", "touchend", "mousedown", "mouseup", "mousemove", "click"];
+ var eventIDX= 0;
+ $("#title").text(eventArr[eventIDX] + " 5 times")
+ .live("click", function() {
+ $(".touchpad").die(eventArr[eventIDX]);
+ eventIDX++;
+ $(this).text(eventArr[eventIDX] + " 5 times");
+ $(".touchpad").live(eventArr[eventIDX], function(e) {
+ if (effects) {
+ balls.eq(numberOfTouch).css("visibility", "")
+ .css("left", e.pageX-25)
+ .css("top", e.pageY-25);
+ }
+ numberOfTouch++;
+ if (numberOfTouch == 5) {
+ window.alert("5 times " + eventArr[eventIDX]);
+ }
+ });
+ });
var balls = $(".ball");
balls.css("visibility", "hidden");
@@ -146,17 +165,6 @@ <h3 id="timer">00:00:00</h3>
$(this).addClass("blue").removeClass("orange")
.siblings().addClass("orange").removeClass("blue");
});
- $(".touchpad").live(events, function(e) {
- if (effects) {
- balls.eq(numberOfTouch).css("visibility", "")
- .css("left", e.pageX-25)
- .css("top", e.pageY-25);
- }
- numberOfTouch++;
- if (numberOfTouch == 5) {
- window.alert("5 times " + events);
- }
- });
});
</script>
</body>
Please sign in to comment.
Something went wrong with that request. Please try again.