I’m working on a web app that has its own look and feel. I want to use jQuery Mobile for the touch events support only.
When I link jquery.mobile.min.js (without linking the css), then the layout of my page is broken.
How can I configure (initialize) jQuery Mobile to only use touch events support? Would I bind the events in the jQuery document ready hook since I'd not have any JQM page related event?
Edit
See this example in jsfiddle: http://jsfiddle.net/redhotsly/JGgrw/. The html contains a <button>
but jQuery Mobile created a <span>
to its left. If you inspect the resulting markup (F12) you will see that jQuery Mobile also added a CSS class to my button.
Edit:
I need a solution where I'll not have modify the JQM script. I need to use the official script off a CDN.
The framework allows developers to build applications that can be accessed by the widest number of browsers and devices, whether it is Internet Explorer 6 or the newest Android or iPhone. Mobile jQuery also gives developers the ability to render basic content (as built) on basic devices.
jQuery Mobile Supported PlatformsjQuery Mobile has broad support for the vast majority of all modern desktop, smartphone, tablet, and e-reader platforms. In addition, feature phones and older browsers are supported because of our progressive enhancement approach.
Features of jQuery MobileOpen-source and freely available for all kind of usages. Cross-platform, cross-device and cross-browser compatible.
If you want to use jQuery mobile for touch events only, add this piece of script before you load the jQuery mobile library:
<script type="text/javascript">$(document).bind("mobileinit", function(){$.extend( $.mobile , {autoInitializePage: false})});</script>
This prevents jquery mobile from initializing the page and touching the DOM, thus leaving your layout alone.
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