Options
Change the default options with $().citypicker(options).
Change the global default options with $.fn.citypicker.setDefaults(options).
simple
Type: Boolean
Default: false
Make the address level more simple, e.g. 内蒙古 instead of 内蒙古自治区.
level
Type: String
Default: district
Only province, province + city, or province + city + district.
responsive
Type: Boolean
Default: false
make the drop down and mask span responsive on width.
placeholder
Type: Boolean
Default: 请输入省/市/区
Show placeholder (with an element).
province
Type: String
Default: null
Defines the initial value of province. If it is a existing province in city-picker.data.js, it will be selected. If not, it will be used as a placeholder.
city
Type: String
Default: null
Defines the initial value of city. If it is a existing city under the
selected province, it will be selected. If not, it will be used as a
placeholder.
district
Type: String
Default: null
Defines the initial value of district. If it is a existing district
under the selected city, it will be selected. If not, it will be used as
a placeholder.
Methods
reset()
Reset the selects to the initial states (Undo changed).
Examples:
$().citypicker('reset');
destroy()
Destroy the city-picker instance, but keep the selected districts.
If you want to remove the selected districts, you can call reset method first and then call this method.
No conflict
If you have to use other plugin with the same namespace, just call the $.fn.city-picker.noConflict method to revert to it.
Browser support
Chrome (latest 2)
Firefox (latest 2)
Internet Explorer 8+
Opera (latest 2)
Safari (latest 2)