Swiping in Cordova with Jquery and jgestures

前端 未结 1 778
不思量自难忘°
不思量自难忘° 2021-01-21 07:44

There are lots of topics in Stackoverflow when it comes to swiping using jQuery/jQuery mobile. However, none of them seem to work in the manner I want. The following is the stru

相关标签:
1条回答
  • 2021-01-21 08:33

    Looks like this question had a similar issue. The solution was do something like this:

    document.addEventListener("deviceready", function(){
        $('#screen1').bind('swipeleft',showNext); //show next hides screen1, shows screen2 
        $('#screen2').bind('swiperight',showPrev);//show prev hides screen2, shows screen1
    },false);
    

    Or perhaps you simply need to define the function onDeviceReady BEFORE you call the event listener.

    0 讨论(0)
提交回复
热议问题