Uncaught TypeError in jQTouch

2019-08-30 07:01发布

问题:

I am trying to use the swipe event in jQtouch. For that purpose, i have a code which uses latest jQtouch.js . But, when i try to initialize this, i get this error in my browser console :

Uncaught TypeError: undefined is not a function

The error is present here in this line :

 var jQT = new $.jQTouch({

}); 

However, if i do not use this line , then the swipe event does not work, since, jQtouch dose not get initialized.

I have no idea how to solve this . Any help will be appreciated !

回答1:

Try using the plugin from here

https://github.com/senchalabs/jQTouch/blob/eb1291bf336462d7c5aa2521838ecf797395442a/src/reference/jqtouch.js

and then you can initialize using

var jQT = new $.jQTouch({

});