[Open Source] jquery provincial/municipal plug-ins, open source jquery provincial/municipal
First, demonstration address: http://jasonlong-7.github.io/jquery-city/
1.animation effects use animate.css
2. Supports selection and keyboard input (in Chinese and English)
3. json format returned by the server
{"Provinces": [{"code": "1000", "name": "Beijing"}], "citys": [{"code": "100001 ", "name": "BEIJING", "fullPY": "BEIJING", "firstPY": "OBJ", "provinceCode": "1000", "provinceName": "BEIJING ", "hotCity": true}], "areas": [{"code": "10000101", "name": "Dongcheng District", "cityId": "100001 ", "fullPY": "DONGCHENGOU", "firstPY": "DCO", "provinceCode": "1000", "provinceName": "Beijing", "cityCode": "100001 ", "cityName": "Beijing"}]}
4. How to use it?
1 ).REFERENCE The following css Resources
<Link href = "../css/jquery.city.css" rel = "stylesheet"/> <link href = "../css/animate.min.css" rel = "stylesheet"/> <! -- Optional -->
2 ).<body>
REFERENCE The following js Resources
<script src="../js/jquery-1.10.2.js"></script><script src="../js/jquery.city.js"></script>
3). Example
1 <script> 2 $ (function () {3 $ ('# txt_city '). jcity ({4 urlOrData: '/js/citydata. json', 5 animate: {showClass: 'animated flipoutx', hideClass: 'animated flipoutx'}, // you can define Animation 6 onChoice: function (data) {7 console. log (data); 8} 9}); 10}); 11 </script>
Reprinted please mark the original address: http://www.cnblogs.com/JasonLong/p/5278955.html