I am using jquery mobile. I just wanted to stop jquery mobile to do anything unless I explicitly call trigger('create') method. Is there a way to stop jquery mobile auto initialization for some time.
You can do it by adding this attribute:
data-enhance="false"
to a wanted container.
And you also need to turn this on in the app loading phase:
$(document).one("mobileinit", function () {
$.mobile.ignoreContentEnabled=true;
});
More about this can be found here:
http://jquerymobile.com/test/docs/pages/page-scripting.html
Example:
http://jsfiddle.net/Gajotres/Xjurd/
You can test it by enabling/disabling $.mobile.ignoreContentEnabled=true;
Second option is to do it manually with this line:
data-role="none"
Example:
http://jsfiddle.net/Gajotres/LqDke/
EDIT :
To recreate a page again use this:
$('#index').live('pagebeforeshow', function (event) {
$.mobile.ignoreContentEnabled = false;
$(this).attr('data-enhance','true');
$(this).trigger("pagecreate")
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With