Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 8d0f435ec4
Fetching contributors…

Cannot retrieve contributors at this time

87 lines (78 sloc) 2.628 kB
<!DOCTYPE html>
<html>
<head>
<title>Touch Shim</title>
<style>
#touch
{
width: 600px;
height: 600px;
background-color: Gray;
float: left;
}
#touch2
{
width: 300px;
height: 300px;
background-color: Green;
float: left;
}
#log
{
width: 300px;
height: 600px;
background-color: Silver;
float: left;
}
</style>
<script src="js/modernizr.custom.touch.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.6.1.min.js" type="text/javascript"></script>
<script src="js/touchshim.js" type="text/javascript"></script>
</head>
<body>
<p>
Allows IE9 to handle the W3C touch events (currently draft)</p>
<div id="add">
Add handler</div>
<div id="remove">
remove handler</div>
<div id="log">
</div>
<div id="touch">
<div id="touch2">
</div>
</div>
<script>
$(document).ready(function () {
$('#add').click(function () {
function touchstart(evt) {
var touchEvent = evt.touches[0];
log('touchstart Grey');
}
TOUCH.addEventListener('touchstart', 'touch', touchstart);
TOUCH.addEventListener('touchstart', 'touch2', function (evt) {
var touchEvent = evt.touches[0];
log('touchstart Green');
});
TOUCH.addEventListener('touchend', 'touch2', function (evt) {
var touchEvent = evt.touches[0];
log('touchend Green');
});
TOUCH.addEventListener('touchenter', 'touch2', function (evt) {
var touchEvent = evt.touches[0];
log('touchenter Green');
});
TOUCH.addEventListener('touchleave', 'touch2', function (evt) {
var touchEvent = evt.touches[0];
log('touchleave Green');
});
TOUCH.addEventListener('touchmove', 'touch', function (evt) {
var touchEvent = evt.touches[0];
log('touchmove Grey: ' + touchEvent.clientX + ' ' + touchEvent.clientY + ' ' + touchEvent.identifier + ' ' + touchEvent.timespan);
});
});
});
</script>
<input type="button" id="test" value="Test" />
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.