Adding jquery mobile swipe event

后端 未结 5 2109
春和景丽
春和景丽 2020-12-04 15:45

I have a listview and what I am trying to do is add a swipe event on the links. For example, if a user swipes the first link it goes to that page. Is this possible with list

5条回答
  •  佛祖请我去吃肉
    2020-12-04 16:29

    Have you tried using binding using live()?

    UPDATE: .live() will be deprecated and the correct usage is .on()

    It attaches the handler to the event for all current matching elements as well as those that might match later on.

    pageCreate() {
      $(parent).on('swipe', 'li.rqstpage', function() {
         $.mobile.changePage("requests.php", "slide");
      }
    }
    

    Have you considred using this library for gestures?

提交回复
热议问题