Question

Seems that Phonegap 2.5.0 broke something with jQTouch. If in code we try to initialize jQt (as in previously Phonegap releases) with:

var jQT = new $.jQTouch({}=;

document.addEventListener("deviceready", onDeviceReady, true);

// PhoneGap is ready
function onDeviceReady() {
  dosomething();
}

Then it will not work, the app hung on splashscreen. Btw if the jQTouch initialize it's done inside "onDeviceReady" then the app start but the "jQT" object it's not seen globally on code, it will need to be inizialized on every functions?

Please help, Thanks Roob

Was it helpful?

Solution

I made it work by using the structure that comes by default in the index.js file from the phonegap installation for ios like this:

var app = {
    initialize: function() {
        this.bindEvents();
    },

    bindEvents: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },

    onDeviceReady: function() {
        app.receivedEvent('deviceready');
    },

    receivedEvent: function() {

        //jQTouch init here
        var jQT = new $.jQTouch({
            useFastTouch : true,
            touchSelector : 'a, .btn, .touch'
        });

        //Put the rest of your app in here


    }
};

Hope this helps! :)

*dont forget to initialize your app - app.initialize();

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top