+0
日增长
9,582
stars
2,344
forks
0
watchers
2,208
prs
6,449
issues
0
releases
README
jQuery Mobile
_Note: jQuery Mobile is not maintained anymore. Please read the project status blog post for more information._
jQuery Mobile is a unified, HTML5-based user interface system for all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily themeable design.
jQuery Mobile 1.4.x works with versions of jQuery core from 1.8.3 to 1.11.1 / 2.1.1. You can find more information about how the library works, and what it is capable of, by reading the documentation and exploring the demos. Alternatively, more information can also be found on the jquerymobile site.
Contributing
You can contribute to the project by reporting issues, suggesting new features, or submitting pull requests.
Please read our Contributing Guidelines before submitting.
Build/Customization
Currently the library is shipped on the jQuery CDN/download as a single monolithic JavaScript file that depends on jQuery Core (not included) and a similarly bundled CSS file. For users we support the following build targets:
js - resolve dependencies, build, concat, and minify the JavaScript used for jQuery Mobile
css - resolve dependencies, build, concat, and minify all the css, just the structure css, and just the theme css
demos - build the js and css, and make the docs ready for static consumption
lint - Validates JavaScript files using JSHint
Download Builder
The easiest way to obtain a custom build is to use the download builder. With it, you can select the parts of the library you need and both the CSS and JavaScript dependencies will be resolved for you as a packaged/minified whole.
Requirements
node.js
grunt-cli
Commands
With node and grunt installed you can run the default target by simply issuing the following from the project root:
npm install
grunt
JavaScript
As of version 1.1 the library uses dependency management in the JavaScript build by providing AMD modules which can be added or removed from the core mobile meta module js/jquery.mobile.js.
For example, if a user wished to exclude the form widgets to reduce the wire weight of their jQuery Mobile include they would first remove them from the meta module:
diff
diff --git a/js/jquery.mobile.js b/js/jquery.mobile.js
index 6200fe6..3a4625c 100644
--- a/js/jquery.mobile.js
+++ b/js/jquery.mobile.js
@@ -19,12 +19,6 @@ define(
'./jquery.mobile.listview.filter',
'./jquery.mobile.listview.autodividers',
'./jquery.mobile.nojs',
- './jquery.mobile.forms.checkboxradio',
- './jquery.mobile.forms.button',
- './jquery.mobile.forms.slider',
- './jquery.mobile.forms.textinput',
- './jquery.mobile.forms.select.custom',
- './jquery.mobile.forms.select',
'./jquery.mobile.buttonMarkup',
'./jquery.mobile.controlGroup',
'./jquery.mobile.links',
And then run the build:
grunt build:js
CSS
To crTop issues
#5534Swipe is buggy on Chrome/Android108 comments · 2013-01-26#8612Can we all admit this project is dead?87 comments · 2018-02-07#5532Fixed header jumps around when iOS keyboard disappears35 comments · 2013-01-25#8640Security issues18 comments · 2018-12-01#7797Header with data-position fixed renders too wide in IOS(8.1) (iPhone4/5/6)17 comments · 2014-10-22#8381JQM 1.4.5 doesn't support jQuery 2.2.016 comments · 2016-02-14#6656PageContainer: dynamically injected pages will not be removed from DOM automatically on hide13 comments · 2013-10-25#5069prevent generation of new hash on form submit13 comments · 2012-09-22