HOME

tap event 페이지

tap 이벤트 설정 방법

jquery-mobile에서 제공하는 터치 이벤트로는 tap,taphold,swipe,swipeleft,swiperight 이렇게 5가지가 있다.

1.tap은 마우스 클릭과 같은 이벤트로 화면을 가볍게 터치했을때 발생하는 이벤트 이다.

ex) $('#tapTarget').on("tap",function(e){ $('#eText1').html(e.type); });



이곳을 터치 or 클릭 하여 이벤트 확인


2.taphold는 해당 태그를 1초이상 누르고 있을때 발생하는 이벤트 이다.

ex) $('#tapholdTarget').on("taphold",function(e){ $('#eText2').html(e.type); });



1초간 누르고 있을때 이벤트 확인 이벤트 확인


3.swipe는 해당 영역에 좌우로 드래그 같은 상황이 발생했을때의 이벤트이나 좌우의 개념이 없다.

ex) $('#swipeTarget').on("swipe",function(e){ $('#eText3').html(e.type); });



좌우 드래그 or 움직임 이벤트 확인


4.swipeleft swiperight는 swipe가 발생 했을때 left인지right인지 구분하여 발생하는 이벤트이다.

ex) $('#swipelrTarget').on("swipeleft swiperight",function(e){ $('#eText4').html(e.type); });



좌우로 드래그 or 움직임 위치 이벤트 확인