Reputation: 11
hello i am a new student studying programmer. I was given a question from my lecturer to make a script with the question command: "click the link to another page in a paragraph when the phone screen is touched or swiped". I am very grateful for all the answers given by you guys. Thanks ..
this is my script
<script>
$(document).on('touchstart', function() {
documentClick = true;
});
$(document).on('touchmove', function() {
documentClick = true;
});
$(document).on('click touchend', function(event) {
if (event.type == "click") documentClick = true;
if (documentClick){
doStuff();
}
});
</script>
Upvotes: 1
Views: 68