JS Mobile Phone Linkage selection region
Foreword: Because the net found a mobiscrool, compare whole, but not open source, can only try 15 days, the official edition unexpectedly wants 3,000 yuan, the poor can only do their own hands, wrote a only for the pop-window region selected.
All the resources on this site can be viewed on GitHub with source code GitHub
Demo address please click here http://www.lovewebgames.com/jsmodule/mobile-select-area.html
Mobile-select-area
Mobile phone linkage Selection region
Usage
##注:依赖于[dialog](https://github.com/tianxiangbing/dialog)
<! doctype>
Properties and methods Trigger: 触发弹窗的DOM元素 ,可以是input或其他
Value 初始值,
Data 当data为json对象时可以直接解析 当data为string发送ajax请求后返回json,格式如下:
{" data": [{ "id": 1, "name": "Zhejiang Province", "child": [{ "id": "1", "name": "Hangzhou City", "child": [{ "id": 1, "name": "Bingjiang District" }] }] }, { "id": 2, "name": "Jiangsu Province", "child": [{ "id": " 1 ", " name ":" Nanjing ", " child ": [{ " id ": 1, " name ":" Liberated Area " }] }] }, { " id ": 3, "name": "Hubei Province" }] }
Callback 选中后的回调,默认有填充trigger的value值,以及赋值它后面紧跟着的hidden的value值,以逗号分隔id,空格分隔文字
JS Phone linkage Select region imitation iOS open source git