首页 > 代码库 > mobiscroll日期选择插件移动端插件文本选择插件

mobiscroll日期选择插件移动端插件文本选择插件

 

移动端选择插件mobiscroll的使用demo

一开始是弄个日期选择的插件,网上看到这个mobiscroll这个插件,然后各种下各种找demo,最后自己研究了一天下面把自己项目的demo拔出来分享给大家(以及文件下载),多多海涵,如果大家看了我的这文章有更好的写法还望赐教~

首先是常用的日期使用:

HTML部分: 

 
  1. <li id="birthday">  
  2.     <div class="mbase-menu-title">生日</div>  
  3.     <div  
  4.         class="mbase-menu-txt">未设置</div>  
  5.     <div class="clear"></div>  
  6. </li>  
JS部分:

 

 
  1. $("#birthday").mobiscroll().date({  
  2.             theme: "android-ics",  
  3.             lang: "zh",  
  4.             display: ‘bottom‘,  
  5.             dateFormat: ‘yy-mm-dd‘, //返回结果格式化为年月格式  
  6.             // wheels:[], 设置此属性可以只显示年月,此处演示,就用下面的onBeforeShow方法,另外也可以用treelist去实现  
  7.             //onBeforeShow: function (inst) { inst.settings.wheels[0].length>2?inst.settings.wheels[0].pop():null; }, //弹掉“日”滚轮  
  8.             headerText: function (valueText) { //自定义弹出框头部格式  
  9.                 array = valueText.split(‘-‘);  
  10.                 return array[0] + "年" + array[1] + "月" + array[2] + "日";  
  11.             },  
  12.             onSelect: function (valueText, inst) {  
  13.                 $(this).find(".mbase-menu-txt").html(valueText);  
  14.                 /*$.post("inc/person.org.php", {apart: "resume_base", birthday: valueText}, function (result) { 
  15.                     if (result == ‘ok‘) { 
  16.                         $(this).find(".mbase-menu-txt").html(valueText); 
  17.                     } 
  18.                     else { 
  19.                         error(‘网络繁忙,请您稍后再试‘); 
  20.                     } 
  21.                 });*/ 这是后端入库部分  
  22.             }  
  23.         });  
这上门就是这个插件用在日期选择的部分,比较简单,查查api就知道了。这是效果图

 

技术分享

下面的是treelist的,这个可用在比如选择文本项的时候,就因为这点我才觉得它真的够强大:

单项选择文本的

HTML部分:

 

 
  1. <li id="sex">  
  2.             <div class="mbase-menu-title">性别</div>  
  3.             <div class="mbase-menu-txt">未设置</div>  
  4.             <div class="clear"></div>  
  5.  </li>  
 
  1. <ul id="sex-list" style="display: none">  
  2.     <li>先生</li>  
  3.     <li>女士</li>  
  4. </ul>  

 

JS部分:

 

[javascript] view plain copy
 
  1. $("#sex").click(function () {  
  2.             var that = this;  
  3.             $("#sex-list").mobiscroll().treelist({  
  4.                 theme: "android-ics",  
  5.                 lang: "zh",  
  6.                 display: ‘bottom‘,  
  7.                 inputClass: ‘tmp‘,  
  8.                 headerText: ‘请您选择‘,  
  9.                 onSelect: function (valueText) {  
  10.                     var m = $(this).find("li").eq(valueText).html();  
  11.                     /*$.post("inc/person.org.php", {apart: "resume_base", sex: m}, function (result) { 
  12.                         if (result == ‘ok‘) { 
  13.                             $(that).find(".mbase-menu-txt").html(m); 
  14.                         } 
  15.                         else { 
  16.                             error(‘网络繁忙,请您稍后再试‘); 
  17.                         } 
  18.                     });*/后端入库部分  
  19.                 }  
  20.             });  
  21.             $("input[id^=sex-list]").focus();  
  22.         });  
这里我说明下 由于我的项目结构比较例外,所以我才这样写的,官方的demo是直接
[javascript] view plain copy
 
  1. $("#sex-list").mobiscroll().treelist({..})  
[javascript] view plain copy
 
  1. 这因情况而异,后面那段<pre name="code" class="javascript">$("input[id^=sex-list]").focus();  
 
  1. 这里可能会问怎么回事啊,我也不知道怎么回事,只是我发现只要调用<pre name="code" class="javascript"><pre name="code" class="javascript">mobiscroll().treelist 的元素会自动变成input,然后弹出让你选择,这里我的项目结构为了美观,预算我设置了个inputClass:‘tmp‘   
 
  1. 这个tmp就是样式名,属性就一个透明度为0(<pre style="background-color:#272822;color:#f8f8f2;font-family:‘Consolas‘;font-size:12.0pt;"><span style="color:#f92672;">input</span>.<span style="color:#a6e22e;">tmp</span>{  
  2.     <span style="color:#66d9ef;"><em>opacity</em></span>: <span style="color:#ae81ff;">0</span>;  
  3. }  
),这样就遮丑了。还有一点要注意的就是
  1. valueText 这个参数在treelist方法里面是返回当前选择的第几个元素li的值。 

技术分享

下面这个是两列选择的:

HTML部分:

 

[html] view plain copy
 
  1. <li id="current-area">  
  2.             <div class="mbase-menu-title">现所在地</div>  
  3.             <div class="mbase-menu-txt">未设置</div>  
  4.             <div class="clear"></div>  
  5. </li>  

[html] view plain copy
 
  1. <ul id="education-list" style="display: none">  
  2.             <li data-value=http://www.mamicode.com/"72">初中</li>  
  3.             <li data-value=http://www.mamicode.com/"73">高中</li>  
  4.             <li data-value=http://www.mamicode.com/"74">中技</li>  
  5.             <li data-value=http://www.mamicode.com/"75">中专</li>  
  6.             <li data-value=http://www.mamicode.com/"76">大专</li>  
  7.             <li data-value=http://www.mamicode.com/"77">本科</li>  
  8.             <li data-value=http://www.mamicode.com/"78">硕士</li>  
  9.             <li data-value=http://www.mamicode.com/"79">MBA/EMBA</li>  
  10.             <li data-value=http://www.mamicode.com/"80">博士</li>  
  11.             <li data-value=http://www.mamicode.com/"81">博士后</li>  
  12.     </ul>  
  13. <ul id="current-area-list" style="display: none">  
  14.            <li><div data-value=http://www.mamicode.com/"2">北京</div>  
  15.        <ul>  
  16.                      <li data-value=http://www.mamicode.com/"36">东城</li>  
  17.                      <li data-value=http://www.mamicode.com/"37">西城</li>  
  18.                      <li data-value=http://www.mamicode.com/"38">崇文</li>  
  19.                      <li data-value=http://www.mamicode.com/"39">宣武</li>  
  20.                      <li data-value=http://www.mamicode.com/"40">朝阳</li>  
  21.                      <li data-value=http://www.mamicode.com/"41">丰台</li>  
  22.                      <li data-value=http://www.mamicode.com/"42">石景山</li>  
  23.                      <li data-value=http://www.mamicode.com/"43">海淀</li>  
  24.                      <li data-value=http://www.mamicode.com/"44">门头沟</li>  
  25.                      <li data-value=http://www.mamicode.com/"45">房山</li>  
  26.                      <li data-value=http://www.mamicode.com/"46">通州</li>  
  27.                      <li data-value=http://www.mamicode.com/"47">顺义</li>  
  28.                      <li data-value=http://www.mamicode.com/"48">昌平</li>  
  29.                      <li data-value=http://www.mamicode.com/"49">大兴</li>  
  30.                      <li data-value=http://www.mamicode.com/"50">平谷</li>  
  31.                      <li data-value=http://www.mamicode.com/"51">怀柔</li>  
  32.                      <li data-value=http://www.mamicode.com/"52">密云</li>  
  33.                      <li data-value=http://www.mamicode.com/"53">延庆</li>  
  34.                   </ul>  
  35.        </li>  
  36.            <li><div data-value=http://www.mamicode.com/"3">天津</div>  
  37.        <ul>  
  38.                      <li data-value=http://www.mamicode.com/"54">和平</li>  
  39.                      <li data-value=http://www.mamicode.com/"55">河东</li>  
  40.                      <li data-value=http://www.mamicode.com/"56">河西</li>  
  41.                      <li data-value=http://www.mamicode.com/"57">南开</li>  
  42.                      <li data-value=http://www.mamicode.com/"58">红桥</li>  
  43.                      <li data-value=http://www.mamicode.com/"59">塘沽</li>  
  44.                      <li data-value=http://www.mamicode.com/"60">汉沽</li>  
  45.                      <li data-value=http://www.mamicode.com/"61">大港</li>  
  46.                      <li data-value=http://www.mamicode.com/"62">东丽</li>  
  47.                      <li data-value=http://www.mamicode.com/"63">西青</li>  
  48.                      <li data-value=http://www.mamicode.com/"64">津南</li>  
  49.                      <li data-value=http://www.mamicode.com/"65">北辰</li>  
  50.                      <li data-value=http://www.mamicode.com/"66"> 宁河</li>  
  51.                      <li data-value=http://www.mamicode.com/"67">武清</li>  
  52.                      <li data-value=http://www.mamicode.com/"68">静海</li>  
  53.                      <li data-value=http://www.mamicode.com/"69">宝坻</li>  
  54.                      <li data-value=http://www.mamicode.com/"70">蓟州</li>  
  55.                   </ul>  
  56.        </li>  
  57.            <li><div data-value=http://www.mamicode.com/"4">河北</div>  
  58.        <ul>  
  59.                      <li data-value=http://www.mamicode.com/"71">石家庄</li>  
  60.                      <li data-value=http://www.mamicode.com/"72">唐山</li>  
  61.                      <li data-value=http://www.mamicode.com/"73">秦皇岛</li>  
  62.                      <li data-value=http://www.mamicode.com/"74">邯郸</li>  
  63.                      <li data-value=http://www.mamicode.com/"75">邢台</li>  
  64.                      <li data-value=http://www.mamicode.com/"76">保定</li>  
  65.                      <li data-value=http://www.mamicode.com/"77">张家口</li>  
  66.                      <li data-value=http://www.mamicode.com/"78">承德</li>  
  67.                      <li data-value=http://www.mamicode.com/"79">沧州</li>  
  68.                      <li data-value=http://www.mamicode.com/"80">廊坊</li>  
  69.                      <li data-value=http://www.mamicode.com/"81">衡水</li>  
  70.                   </ul>  
  71.        </li>  
  72.            <li><div data-value=http://www.mamicode.com/"5">山西</div>  
  73.        <ul>  
  74.                      <li data-value=http://www.mamicode.com/"82">太原</li>  
  75.                      <li data-value=http://www.mamicode.com/"83">大同</li>  
  76.                      <li data-value=http://www.mamicode.com/"84">阳泉</li>  
  77.                      <li data-value=http://www.mamicode.com/"85">长治</li>  
  78.                      <li data-value=http://www.mamicode.com/"86">晋中</li>  
  79.                      <li data-value=http://www.mamicode.com/"87">运城</li>  
  80.                      <li data-value=http://www.mamicode.com/"88">忻州</li>  
  81.                      <li data-value=http://www.mamicode.com/"89">临汾</li>  
  82.                      <li data-value=http://www.mamicode.com/"90">吕梁</li>  
  83.                   </ul>  
  84.        </li>  
  85.            <li><div data-value=http://www.mamicode.com/"6">内蒙古</div>  
  86.        <ul>  
  87.                      <li data-value=http://www.mamicode.com/"91">呼和浩特</li>  
  88.                      <li data-value=http://www.mamicode.com/"92">包头</li>  
  89.                      <li data-value=http://www.mamicode.com/"93">乌海</li>  
  90.                      <li data-value=http://www.mamicode.com/"94">赤峰</li>  
  91.                      <li data-value=http://www.mamicode.com/"95">通辽</li>  
  92.                      <li data-value=http://www.mamicode.com/"96">鄂尔多斯</li>  
  93.                      <li data-value=http://www.mamicode.com/"97">呼伦贝尔</li>  
  94.                      <li data-value=http://www.mamicode.com/"98">巴彦淖尔</li>  
  95.                      <li data-value=http://www.mamicode.com/"99">乌兰察布</li>  
  96.                      <li data-value=http://www.mamicode.com/"100">海拉尔</li>  
  97.                      <li data-value=http://www.mamicode.com/"101">集宁</li>  
  98.                      <li data-value=http://www.mamicode.com/"102">巴彦浩特</li>  
  99.                      <li data-value=http://www.mamicode.com/"103">锡林浩特</li>  
  100.                      <li data-value=http://www.mamicode.com/"104">临河</li>  
  101.                      <li data-value=http://www.mamicode.com/"105">乌兰察布盟</li>  
  102.                      <li data-value=http://www.mamicode.com/"106">兴安盟</li>  
  103.                      <li data-value=http://www.mamicode.com/"107">阿拉善盟</li>  
  104.                      <li data-value=http://www.mamicode.com/"108">兴安</li>  
  105.                      <li data-value=http://www.mamicode.com/"109">锡林郭勒</li>  
  106.                      <li data-value=http://www.mamicode.com/"110">阿拉善</li>  
  107.                   </ul>  
  108.        </li>  
  109.            <li><div data-value=http://www.mamicode.com/"7">辽宁</div>  
  110.        <ul>  
  111.                      <li data-value=http://www.mamicode.com/"111">沈阳</li>  
  112.                      <li data-value=http://www.mamicode.com/"112">大连</li>  
  113.                      <li data-value=http://www.mamicode.com/"113">鞍山</li>  
  114.                      <li data-value=http://www.mamicode.com/"114">抚顺</li>  
  115.                      <li data-value=http://www.mamicode.com/"115">本溪</li>  
  116.                      <li data-value=http://www.mamicode.com/"116">丹东</li>  
  117.                      <li data-value=http://www.mamicode.com/"117">锦州</li>  
  118.                      <li data-value=http://www.mamicode.com/"118">营口</li>  
  119.                      <li data-value=http://www.mamicode.com/"119">阜新</li>  
  120.                      <li data-value=http://www.mamicode.com/"120">辽阳</li>  
  121.                      <li data-value=http://www.mamicode.com/"121">盘锦</li>  
  122.                      <li data-value=http://www.mamicode.com/"122">铁岭</li>  
  123.                      <li data-value=http://www.mamicode.com/"123">葫芦岛</li>  
  124.                   </ul>  
  125.        </li>  
  126.            <li><div data-value=http://www.mamicode.com/"8">吉林</div>  
  127.        <ul>  
  128.                      <li data-value=http://www.mamicode.com/"124">长春</li>  
  129.                      <li data-value=http://www.mamicode.com/"125">四平</li>  
  130.                      <li data-value=http://www.mamicode.com/"126">辽源</li>  
  131.                      <li data-value=http://www.mamicode.com/"127">通化</li>  
  132.                      <li data-value=http://www.mamicode.com/"128">白山</li>  
  133.                      <li data-value=http://www.mamicode.com/"129">松源</li>  
  134.                      <li data-value=http://www.mamicode.com/"130">白城</li>  
  135.                      <li data-value=http://www.mamicode.com/"131">梅河口</li>  
  136.                      <li data-value=http://www.mamicode.com/"132">珲春</li>  
  137.                      <li data-value=http://www.mamicode.com/"133">延吉</li>  
  138.                      <li data-value=http://www.mamicode.com/"134">延边</li>  
  139.                   </ul>  
  140.        </li>  
  141.            <li><div data-value=http://www.mamicode.com/"9">黑龙江</div>  
  142.        <ul>  
  143.                      <li data-value=http://www.mamicode.com/"135">哈尔滨</li>  
  144.                      <li data-value=http://www.mamicode.com/"136">齐齐哈尔</li>  
  145.                      <li data-value=http://www.mamicode.com/"137">鸡西</li>  
  146.                      <li data-value=http://www.mamicode.com/"138">鹤岗</li>  
  147.                      <li data-value=http://www.mamicode.com/"139">双鸭山</li>  
  148.                      <li data-value=http://www.mamicode.com/"140">大庆</li>  
  149.                      <li data-value=http://www.mamicode.com/"141">伊春</li>  
  150.                      <li data-value=http://www.mamicode.com/"142">佳木斯</li>  
  151.                      <li data-value=http://www.mamicode.com/"143">七台河</li>  
  152.                      <li data-value=http://www.mamicode.com/"144">牡丹江</li>  
  153.                      <li data-value=http://www.mamicode.com/"145">黑河</li>  
  154.                      <li data-value=http://www.mamicode.com/"146">绥化</li>  
  155.                      <li data-value=http://www.mamicode.com/"147">大兴安岭</li>  
  156.                   </ul>  
  157.        </li>  
  158.            <li><div data-value=http://www.mamicode.com/"10">上海</div>  
  159.        <ul>  
  160.                      <li data-value=http://www.mamicode.com/"148">黄浦</li>  
  161.                      <li data-value=http://www.mamicode.com/"149">南区</li>  
  162.                      <li data-value=http://www.mamicode.com/"150">卢湾</li>  
  163.                      <li data-value=http://www.mamicode.com/"151">徐汇</li>  
  164.                      <li data-value=http://www.mamicode.com/"152">长宁</li>  
  165.                      <li data-value=http://www.mamicode.com/"153">静安</li>  
  166.                      <li data-value=http://www.mamicode.com/"154">普陀</li>  
  167.                      <li data-value=http://www.mamicode.com/"155">闸北</li>  
  168.                      <li data-value=http://www.mamicode.com/"156">虹口</li>  
  169.                      <li data-value=http://www.mamicode.com/"157">杨浦</li>  
  170.                      <li data-value=http://www.mamicode.com/"158">闵行</li>  
  171.                      <li data-value=http://www.mamicode.com/"159">宝山</li>  
  172.                      <li data-value=http://www.mamicode.com/"160">嘉定</li>  
  173.                      <li data-value=http://www.mamicode.com/"161">浦东新区</li>  
  174.                      <li data-value=http://www.mamicode.com/"162">金山</li>  
  175.                      <li data-value=http://www.mamicode.com/"163">松江</li>  
  176.                      <li data-value=http://www.mamicode.com/"164">南汇</li>  
  177.                      <li data-value=http://www.mamicode.com/"165">奉贤</li>  
  178.                      <li data-value=http://www.mamicode.com/"166">青浦</li>  
  179.                      <li data-value=http://www.mamicode.com/"167">崇明</li>  
  180.                   </ul>  
  181.        </li>  
  182.            <li><div data-value=http://www.mamicode.com/"11">江苏</div>  
  183.        <ul>  
  184.                      <li data-value=http://www.mamicode.com/"168">南京</li>  
  185.                      <li data-value=http://www.mamicode.com/"169">无锡</li>  
  186.                      <li data-value=http://www.mamicode.com/"170">徐州</li>  
  187.                      <li data-value=http://www.mamicode.com/"171">常州 </li>  
  188.                      <li data-value=http://www.mamicode.com/"172">苏州</li>  
  189.                      <li data-value=http://www.mamicode.com/"173">南通</li>  
  190.                      <li data-value=http://www.mamicode.com/"174">连云港</li>  
  191.                      <li data-value=http://www.mamicode.com/"175">淮安 </li>  
  192.                      <li data-value=http://www.mamicode.com/"176">盐城</li>  
  193.                      <li data-value=http://www.mamicode.com/"177">扬州</li>  
  194.                      <li data-value=http://www.mamicode.com/"178">镇江</li>  
  195.                      <li data-value=http://www.mamicode.com/"179">秦州</li>  
  196.                      <li data-value=http://www.mamicode.com/"180">宿迁</li>  
  197.                   </ul>  
  198.        </li>  
  199.            <li><div data-value=http://www.mamicode.com/"12">浙江</div>  
  200.        <ul>  
  201.                      <li data-value=http://www.mamicode.com/"181">杭州</li>  
  202.                      <li data-value=http://www.mamicode.com/"182">宁波</li>  
  203.                      <li data-value=http://www.mamicode.com/"183">温州</li>  
  204.                      <li data-value=http://www.mamicode.com/"184">嘉兴</li>  
  205.                      <li data-value=http://www.mamicode.com/"185">湖州</li>  
  206.                      <li data-value=http://www.mamicode.com/"186">绍兴</li>  
  207.                      <li data-value=http://www.mamicode.com/"187">金华</li>  
  208.                      <li data-value=http://www.mamicode.com/"188">衡州</li>  
  209.                      <li data-value=http://www.mamicode.com/"189">舟山</li>  
  210.                      <li data-value=http://www.mamicode.com/"190">台州</li>  
  211.                      <li data-value=http://www.mamicode.com/"191">丽水</li>  
  212.                   </ul>  
  213.        </li>  
  214.            <li><div data-value=http://www.mamicode.com/"13">安徽</div>  
  215.        <ul>  
  216.                      <li data-value=http://www.mamicode.com/"192">合肥</li>  
  217.                      <li data-value=http://www.mamicode.com/"193">芜湖</li>  
  218.                      <li data-value=http://www.mamicode.com/"194">蚌埠</li>  
  219.                      <li data-value=http://www.mamicode.com/"195">淮南</li>  
  220.                      <li data-value=http://www.mamicode.com/"196">马鞍山</li>  
  221.                      <li data-value=http://www.mamicode.com/"197">淮北</li>  
  222.                      <li data-value=http://www.mamicode.com/"198">铜陵</li>  
  223.                      <li data-value=http://www.mamicode.com/"199">安庆</li>  
  224.                      <li data-value=http://www.mamicode.com/"200">黄山</li>  
  225.                      <li data-value=http://www.mamicode.com/"201">滁州</li>  
  226.                      <li data-value=http://www.mamicode.com/"202">阜阳</li>  
  227.                      <li data-value=http://www.mamicode.com/"203">宿州</li>  
  228.                      <li data-value=http://www.mamicode.com/"204">巢湖</li>  
  229.                      <li data-value=http://www.mamicode.com/"205">六安</li>  
  230.                      <li data-value=http://www.mamicode.com/"206">毫州</li>  
  231.                      <li data-value=http://www.mamicode.com/"207">池州</li>  
  232.                      <li data-value=http://www.mamicode.com/"208">宣城</li>  
  233.                   </ul>  
  234.        </li>  
  235.            <li><div data-value=http://www.mamicode.com/"14">福建</div>  
  236.        <ul>  
  237.                      <li data-value=http://www.mamicode.com/"209">福州</li>  
  238.                      <li data-value=http://www.mamicode.com/"210">厦门</li>  
  239.                      <li data-value=http://www.mamicode.com/"211">莆田</li>  
  240.                      <li data-value=http://www.mamicode.com/"212">三明</li>  
  241.                      <li data-value=http://www.mamicode.com/"213">泉州</li>  
  242.                      <li data-value=http://www.mamicode.com/"214">漳州</li>  
  243.                      <li data-value=http://www.mamicode.com/"215">南平</li>  
  244.                      <li data-value=http://www.mamicode.com/"216">龙岩</li>  
  245.                      <li data-value=http://www.mamicode.com/"217">宁德</li>  
  246.                   </ul>  
  247.        </li>  
  248.            <li><div data-value=http://www.mamicode.com/"15">江西</div>  
  249.        <ul>  
  250.                      <li data-value=http://www.mamicode.com/"218">南昌</li>  
  251.                      <li data-value=http://www.mamicode.com/"219">景德镇</li>  
  252.                      <li data-value=http://www.mamicode.com/"220">萍乡</li>  
  253.                      <li data-value=http://www.mamicode.com/"221">九江</li>  
  254.                      <li data-value=http://www.mamicode.com/"222">新余</li>  
  255.                      <li data-value=http://www.mamicode.com/"223">鹰潭</li>  
  256.                      <li data-value=http://www.mamicode.com/"224">赣州</li>  
  257.                      <li data-value=http://www.mamicode.com/"225">吉安</li>  
  258.                      <li data-value=http://www.mamicode.com/"226">宜春</li>  
  259.                      <li data-value=http://www.mamicode.com/"227">抚州</li>  
  260.                      <li data-value=http://www.mamicode.com/"228">上饶</li>  
  261.                   </ul>  
  262.        </li>  
  263.            <li><div data-value=http://www.mamicode.com/"16">山东</div>  
  264.        <ul>  
  265.                      <li data-value=http://www.mamicode.com/"229">济南</li>  
  266.                      <li data-value=http://www.mamicode.com/"230">青岛</li>  
  267.                      <li data-value=http://www.mamicode.com/"231">淄博</li>  
  268.                      <li data-value=http://www.mamicode.com/"232">枣庄</li>  
  269.                      <li data-value=http://www.mamicode.com/"233">东营</li>  
  270.                      <li data-value=http://www.mamicode.com/"234">烟台</li>  
  271.                      <li data-value=http://www.mamicode.com/"235">潍坊</li>  
  272.                      <li data-value=http://www.mamicode.com/"236">济宁</li>  
  273.                      <li data-value=http://www.mamicode.com/"237">泰安</li>  
  274.                      <li data-value=http://www.mamicode.com/"238">威海</li>  
  275.                      <li data-value=http://www.mamicode.com/"239">日照</li>  
  276.                      <li data-value=http://www.mamicode.com/"240">莱芜</li>  
  277.                      <li data-value=http://www.mamicode.com/"241">临沂</li>  
  278.                      <li data-value=http://www.mamicode.com/"242">德州</li>  
  279.                      <li data-value=http://www.mamicode.com/"243">聊城</li>  
  280.                      <li data-value=http://www.mamicode.com/"244">滨州</li>  
  281.                      <li data-value=http://www.mamicode.com/"245">菏泽</li>  
  282.                   </ul>  
  283.        </li>  
  284.            <li><div data-value=http://www.mamicode.com/"17">河南</div>  
  285.        <ul>  
  286.                      <li data-value=http://www.mamicode.com/"246">郑州</li>  
  287.                      <li data-value=http://www.mamicode.com/"247">开封</li>  
  288.                      <li data-value=http://www.mamicode.com/"248">洛阳</li>  
  289.                      <li data-value=http://www.mamicode.com/"249">平顶山</li>  
  290.                      <li data-value=http://www.mamicode.com/"250">安阳</li>  
  291.                      <li data-value=http://www.mamicode.com/"251">鹤壁</li>  
  292.                      <li data-value=http://www.mamicode.com/"252">新乡</li>  
  293.                      <li data-value=http://www.mamicode.com/"253">焦作</li>  
  294.                      <li data-value=http://www.mamicode.com/"254">濮阳</li>  
  295.                      <li data-value=http://www.mamicode.com/"255">许昌</li>  
  296.                      <li data-value=http://www.mamicode.com/"256">漯河</li>  
  297.                      <li data-value=http://www.mamicode.com/"257">三门峡</li>  
  298.                      <li data-value=http://www.mamicode.com/"258">南阳</li>  
  299.                      <li data-value=http://www.mamicode.com/"259">商丘</li>  
  300.                      <li data-value=http://www.mamicode.com/"260">信阳</li>  
  301.                      <li data-value=http://www.mamicode.com/"261">周口</li>  
  302.                      <li data-value=http://www.mamicode.com/"262">驻马店</li>  
  303.                      <li data-value=http://www.mamicode.com/"263">潢川</li>  
  304.                      <li data-value=http://www.mamicode.com/"264">济源</li>  
  305.                   </ul>  
  306.        </li>  
  307.            <li><div data-value=http://www.mamicode.com/"18">湖北</div>  
  308.        <ul>  
  309.                      <li data-value=http://www.mamicode.com/"265">武汉</li>  
  310.                      <li data-value=http://www.mamicode.com/"266">黄石</li>  
  311.                      <li data-value=http://www.mamicode.com/"267">十堰</li>  
  312.                      <li data-value=http://www.mamicode.com/"268">仙桃</li>  
  313.                      <li data-value=http://www.mamicode.com/"269">宜昌</li>  
  314.                      <li data-value=http://www.mamicode.com/"270">襄阳</li>  
  315.                      <li data-value=http://www.mamicode.com/"271">鄂州</li>  
  316.                      <li data-value=http://www.mamicode.com/"272">荆门</li>  
  317.                      <li data-value=http://www.mamicode.com/"273">孝感</li>  
  318.                      <li data-value=http://www.mamicode.com/"274">荆州</li>  
  319.                      <li data-value=http://www.mamicode.com/"275">黄冈</li>  
  320.                      <li data-value=http://www.mamicode.com/"276">咸宁</li>  
  321.                      <li data-value=http://www.mamicode.com/"277">随州</li>  
  322.                      <li data-value=http://www.mamicode.com/"278">江汉</li>  
  323.                      <li data-value=http://www.mamicode.com/"279">天门</li>  
  324.                      <li data-value=http://www.mamicode.com/"280">潜江</li>  
  325.                      <li data-value=http://www.mamicode.com/"281">神农架区</li>  
  326.                      <li data-value=http://www.mamicode.com/"282">恩施</li>  
  327.                   </ul>  
  328.        </li>  
  329.            <li><div data-value=http://www.mamicode.com/"19">湖南</div>  
  330.        <ul>  
  331.                      <li data-value=http://www.mamicode.com/"283">长沙</li>  
  332.                      <li data-value=http://www.mamicode.com/"284">株洲</li>  
  333.                      <li data-value=http://www.mamicode.com/"285">湘潭</li>  
  334.                      <li data-value=http://www.mamicode.com/"286">衡阳</li>  
  335.                      <li data-value=http://www.mamicode.com/"287">邵阳</li>  
  336.                      <li data-value=http://www.mamicode.com/"288">常德</li>  
  337.                      <li data-value=http://www.mamicode.com/"289">张家界</li>  
  338.                      <li data-value=http://www.mamicode.com/"290">益阳</li>  
  339.                      <li data-value=http://www.mamicode.com/"291">郴州</li>  
  340.                      <li data-value=http://www.mamicode.com/"292">永州</li>  
  341.                      <li data-value=http://www.mamicode.com/"293">怀化</li>  
  342.                      <li data-value=http://www.mamicode.com/"294">娄底</li>  
  343.                      <li data-value=http://www.mamicode.com/"295">吉首</li>  
  344.                      <li data-value=http://www.mamicode.com/"296">湘西</li>  
  345.                   </ul>  
  346.        </li>  
  347.            <li><div data-value=http://www.mamicode.com/"20">广东</div>  
  348.        <ul>  
  349.                      <li data-value=http://www.mamicode.com/"297">广州</li>  
  350.                      <li data-value=http://www.mamicode.com/"298">韶关</li>  
  351.                      <li data-value=http://www.mamicode.com/"299">深圳</li>  
  352.                      <li data-value=http://www.mamicode.com/"300">珠海</li>  
  353.                      <li data-value=http://www.mamicode.com/"301">汕头</li>  
  354.                      <li data-value=http://www.mamicode.com/"302">佛山</li>  
  355.                      <li data-value=http://www.mamicode.com/"303">江门</li>  
  356.                      <li data-value=http://www.mamicode.com/"304">湛江</li>  
  357.                      <li data-value=http://www.mamicode.com/"305">茂名</li>  
  358.                      <li data-value=http://www.mamicode.com/"306">顺德</li>  
  359.                      <li data-value=http://www.mamicode.com/"307">潮阳</li>  
  360.                      <li data-value=http://www.mamicode.com/"308">肇庆</li>  
  361.                      <li data-value=http://www.mamicode.com/"309">惠州</li>  
  362.                      <li data-value=http://www.mamicode.com/"310">梅州</li>  
  363.                      <li data-value=http://www.mamicode.com/"311">汕尾</li>  
  364.                      <li data-value=http://www.mamicode.com/"312">河源</li>  
  365.                      <li data-value=http://www.mamicode.com/"313">阳江</li>  
  366.                      <li data-value=http://www.mamicode.com/"314">清远</li>  
  367.                      <li data-value=http://www.mamicode.com/"315">中山</li>  
  368.                      <li data-value=http://www.mamicode.com/"316">潮州</li>  
  369.                      <li data-value=http://www.mamicode.com/"317">揭阳</li>  
  370.                      <li data-value=http://www.mamicode.com/"318">云浮</li>  
  371.                   </ul>  
  372.        </li>  
  373.            <li><div data-value=http://www.mamicode.com/"21">广西</div>  
  374.        <ul>  
  375.                      <li data-value=http://www.mamicode.com/"319">南宁</li>  
  376.                      <li data-value=http://www.mamicode.com/"320">柳州</li>  
  377.                      <li data-value=http://www.mamicode.com/"321">桂林</li>  
  378.                      <li data-value=http://www.mamicode.com/"322">梧州</li>  
  379.                      <li data-value=http://www.mamicode.com/"323">北海</li>  
  380.                      <li data-value=http://www.mamicode.com/"324">防城港</li>  
  381.                      <li data-value=http://www.mamicode.com/"325">钦州</li>  
  382.                      <li data-value=http://www.mamicode.com/"326">贵港</li>  
  383.                      <li data-value=http://www.mamicode.com/"327">玉林</li>  
  384.                      <li data-value=http://www.mamicode.com/"328">百色</li>  
  385.                      <li data-value=http://www.mamicode.com/"329">贺州</li>  
  386.                      <li data-value=http://www.mamicode.com/"330">河池</li>  
  387.                      <li data-value=http://www.mamicode.com/"331">来宾</li>  
  388.                      <li data-value=http://www.mamicode.com/"332">崇左</li>  
  389.                   </ul>  
  390.        </li>  
  391.            <li><div data-value=http://www.mamicode.com/"22">海南</div>  
  392.        <ul>  
  393.                      <li data-value=http://www.mamicode.com/"333">海口</li>  
  394.                      <li data-value=http://www.mamicode.com/"334">三亚</li>  
  395.                      <li data-value=http://www.mamicode.com/"335">儋州</li>  
  396.                      <li data-value=http://www.mamicode.com/"336">文昌</li>  
  397.                      <li data-value=http://www.mamicode.com/"337">三沙地区</li>  
  398.                      <li data-value=http://www.mamicode.com/"338">琼海</li>  
  399.                   </ul>  
  400.        </li>  
  401.            <li><div data-value=http://www.mamicode.com/"23">重庆</div>  
  402.        <ul>  
  403.                      <li data-value=http://www.mamicode.com/"339">万州</li>  
  404.                      <li data-value=http://www.mamicode.com/"340">涪陵</li>  
  405.                      <li data-value=http://www.mamicode.com/"341">渝中</li>  
  406.                      <li data-value=http://www.mamicode.com/"342">大渡口</li>  
  407.                      <li data-value=http://www.mamicode.com/"343">江北</li>  
  408.                      <li data-value=http://www.mamicode.com/"344">沙坪坝</li>  
  409.                      <li data-value=http://www.mamicode.com/"345">九龙坡</li>  
  410.                      <li data-value=http://www.mamicode.com/"346">南岸</li>  
  411.                      <li data-value=http://www.mamicode.com/"347">北碚</li>  
  412.                      <li data-value=http://www.mamicode.com/"348">万盛</li>  
  413.                      <li data-value=http://www.mamicode.com/"349">双桥</li>  
  414.                      <li data-value=http://www.mamicode.com/"350">渝北</li>  
  415.                      <li data-value=http://www.mamicode.com/"351">巴南</li>  
  416.                      <li data-value=http://www.mamicode.com/"352">长寿</li>  
  417.                      <li data-value=http://www.mamicode.com/"353">綦江</li>  
  418.                      <li data-value=http://www.mamicode.com/"354">潼南</li>  
  419.                      <li data-value=http://www.mamicode.com/"355">铜梁</li>  
  420.                      <li data-value=http://www.mamicode.com/"356">大足</li>  
  421.                      <li data-value=http://www.mamicode.com/"357">荣昌</li>  
  422.                      <li data-value=http://www.mamicode.com/"358">璧山</li>  
  423.                      <li data-value=http://www.mamicode.com/"359">梁平</li>  
  424.                      <li data-value=http://www.mamicode.com/"360">城口</li>  
  425.                      <li data-value=http://www.mamicode.com/"361">丰都</li>  
  426.                      <li data-value=http://www.mamicode.com/"362">垫江</li>  
  427.                      <li data-value=http://www.mamicode.com/"363">武隆</li>  
  428.                      <li data-value=http://www.mamicode.com/"364">忠县</li>  
  429.                      <li data-value=http://www.mamicode.com/"365">开县</li>  
  430.                      <li data-value=http://www.mamicode.com/"366">云阳</li>  
  431.                      <li data-value=http://www.mamicode.com/"367">奉节</li>  
  432.                      <li data-value=http://www.mamicode.com/"368">巫山</li>  
  433.                      <li data-value=http://www.mamicode.com/"369">巫溪</li>  
  434.                      <li data-value=http://www.mamicode.com/"370">黔江</li>  
  435.                      <li data-value=http://www.mamicode.com/"371">石柱</li>  
  436.                      <li data-value=http://www.mamicode.com/"372">秀山</li>  
  437.                      <li data-value=http://www.mamicode.com/"373">酋阳</li>  
  438.                      <li data-value=http://www.mamicode.com/"374">彭水</li>  
  439.                      <li data-value=http://www.mamicode.com/"375">江津</li>  
  440.                      <li data-value=http://www.mamicode.com/"376">合川</li>  
  441.                      <li data-value=http://www.mamicode.com/"377">永川</li>  
  442.                      <li data-value=http://www.mamicode.com/"378">南川</li>  
  443.                   </ul>  
  444.        </li>  
  445.            <li><div data-value=http://www.mamicode.com/"24">四川</div>  
  446.        <ul>  
  447.                      <li data-value=http://www.mamicode.com/"379">成都</li>  
  448.                      <li data-value=http://www.mamicode.com/"380">自贡</li>  
  449.                      <li data-value=http://www.mamicode.com/"381">攀枝花</li>  
  450.                      <li data-value=http://www.mamicode.com/"382">泸州</li>  
  451.                      <li data-value=http://www.mamicode.com/"383">德阳</li>  
  452.                      <li data-value=http://www.mamicode.com/"384">绵阳</li>  
  453.                      <li data-value=http://www.mamicode.com/"385">广元</li>  
  454.                      <li data-value=http://www.mamicode.com/"386">遂宁</li>  
  455.                      <li data-value=http://www.mamicode.com/"387">内江</li>  
  456.                      <li data-value=http://www.mamicode.com/"388">乐山</li>  
  457.                      <li data-value=http://www.mamicode.com/"389">南充</li>  
  458.                      <li data-value=http://www.mamicode.com/"390">眉山</li>  
  459.                      <li data-value=http://www.mamicode.com/"391">宜宾</li>  
  460.                      <li data-value=http://www.mamicode.com/"392">广安</li>  
  461.                      <li data-value=http://www.mamicode.com/"393">达州</li>  
  462.                      <li data-value=http://www.mamicode.com/"394">雅安</li>  
  463.                      <li data-value=http://www.mamicode.com/"395">巴中</li>  
  464.                      <li data-value=http://www.mamicode.com/"396">资阳</li>  
  465.                      <li data-value=http://www.mamicode.com/"397">阿坝</li>  
  466.                      <li data-value=http://www.mamicode.com/"398">甘孜</li>  
  467.                      <li data-value=http://www.mamicode.com/"399">凉山</li>  
  468.                   </ul>  
  469.        </li>  
  470.            <li><div data-value=http://www.mamicode.com/"25">贵州</div>  
  471.        <ul>  
  472.                      <li data-value=http://www.mamicode.com/"400">贵阳</li>  
  473.                      <li data-value=http://www.mamicode.com/"401">六盘水</li>  
  474.                      <li data-value=http://www.mamicode.com/"402">遵义</li>  
  475.                      <li data-value=http://www.mamicode.com/"403">安顺</li>  
  476.                      <li data-value=http://www.mamicode.com/"404">兴义</li>  
  477.                      <li data-value=http://www.mamicode.com/"405">凯里</li>  
  478.                      <li data-value=http://www.mamicode.com/"406">都匀</li>  
  479.                      <li data-value=http://www.mamicode.com/"407">铜仁</li>  
  480.                      <li data-value=http://www.mamicode.com/"408">黔西南</li>  
  481.                      <li data-value=http://www.mamicode.com/"409">毕节</li>  
  482.                      <li data-value=http://www.mamicode.com/"410">黔东南</li>  
  483.                      <li data-value=http://www.mamicode.com/"411">黔南</li>  
  484.                   </ul>  
  485.        </li>  
  486.            <li><div data-value=http://www.mamicode.com/"26">云南</div>  
  487.        <ul>  
  488.                      <li data-value=http://www.mamicode.com/"412">昆明</li>  
  489.                      <li data-value=http://www.mamicode.com/"413">怒江</li>  
  490.                      <li data-value=http://www.mamicode.com/"414">曲靖</li>  
  491.                      <li data-value=http://www.mamicode.com/"415">玉溪</li>  
  492.                      <li data-value=http://www.mamicode.com/"416">保山</li>  
  493.                      <li data-value=http://www.mamicode.com/"417">昭通</li>  
  494.                      <li data-value=http://www.mamicode.com/"418">丽江</li>  
  495.                      <li data-value=http://www.mamicode.com/"419">普洱</li>  
  496.                      <li data-value=http://www.mamicode.com/"420">临沧</li>  
  497.                      <li data-value=http://www.mamicode.com/"421">版纳</li>  
  498.                      <li data-value=http://www.mamicode.com/"422">楚雄</li>  
  499.                      <li data-value=http://www.mamicode.com/"423">红河</li>  
  500.                      <li data-value=http://www.mamicode.com/"424">文山</li>  
  501.                      <li data-value=http://www.mamicode.com/"425">西双版纳</li>  
  502.                      <li data-value=http://www.mamicode.com/"426">大理</li>  
  503.                      <li data-value=http://www.mamicode.com/"427">德宏</li>  
  504.                      <li data-value=http://www.mamicode.com/"428">怒江傈</li>  
  505.                      <li data-value=http://www.mamicode.com/"429">迪庆</li>  
  506.                   </ul>  
  507.        </li>  
  508.            <li><div data-value=http://www.mamicode.com/"27">西藏</div>  
  509.        <ul>  
  510.                      <li data-value=http://www.mamicode.com/"430">拉萨</li>  
  511.                      <li data-value=http://www.mamicode.com/"431">昌都</li>  
  512.                      <li data-value=http://www.mamicode.com/"432">山南</li>  
  513.                      <li data-value=http://www.mamicode.com/"433">日喀则</li>  
  514.                      <li data-value=http://www.mamicode.com/"434">那曲</li>  
  515.                      <li data-value=http://www.mamicode.com/"435">阿里</li>  
  516.                      <li data-value=http://www.mamicode.com/"436">林芝</li>  
  517.                   </ul>  
  518.        </li>  
  519.            <li><div data-value=http://www.mamicode.com/"28">陕西</div>  
  520.        <ul>  
  521.                      <li data-value=http://www.mamicode.com/"437">西安</li>  
  522.                      <li data-value=http://www.mamicode.com/"438">铜川</li>  
  523.                      <li data-value=http://www.mamicode.com/"439">宝鸡</li>  
  524.                      <li data-value=http://www.mamicode.com/"440">咸阳</li>  
  525.                      <li data-value=http://www.mamicode.com/"441">渭南</li>  
  526.                      <li data-value=http://www.mamicode.com/"442">延安</li>  
  527.                      <li data-value=http://www.mamicode.com/"443">汉中</li>  
  528.                      <li data-value=http://www.mamicode.com/"444">榆林</li>  
  529.                      <li data-value=http://www.mamicode.com/"445">安康</li>  
  530.                      <li data-value=http://www.mamicode.com/"446">商洛</li>  
  531.                   </ul>  
  532.        </li>  
  533.            <li><div data-value=http://www.mamicode.com/"29">甘肃</div>  
  534.        <ul>  
  535.                      <li data-value=http://www.mamicode.com/"447">兰州</li>  
  536.                      <li data-value=http://www.mamicode.com/"448">嘉峪关</li>  
  537.                      <li data-value=http://www.mamicode.com/"449">金昌</li>  
  538.                      <li data-value=http://www.mamicode.com/"450">白银</li>  
  539.                      <li data-value=http://www.mamicode.com/"451">天水</li>  
  540.                      <li data-value=http://www.mamicode.com/"452">武威</li>  
  541.                      <li data-value=http://www.mamicode.com/"453">张掖</li>  
  542.                      <li data-value=http://www.mamicode.com/"454">平京</li>  
  543.                      <li data-value=http://www.mamicode.com/"455">酒泉</li>  
  544.                      <li data-value=http://www.mamicode.com/"456">庆阳</li>  
  545.                      <li data-value=http://www.mamicode.com/"457">定西</li>  
  546.                      <li data-value=http://www.mamicode.com/"458">陇南</li>  
  547.                      <li data-value=http://www.mamicode.com/"459">临夏</li>  
  548.                      <li data-value=http://www.mamicode.com/"460">甘南</li>  
  549.                   </ul>  
  550.        </li>  
  551.            <li><div data-value=http://www.mamicode.com/"30">青海</div>  
  552.        <ul>  
  553.                      <li data-value=http://www.mamicode.com/"461">西宁</li>  
  554.                      <li data-value=http://www.mamicode.com/"462">格尔木</li>  
  555.                      <li data-value=http://www.mamicode.com/"463">海东</li>  
  556.                      <li data-value=http://www.mamicode.com/"464">海北</li>  
  557.                      <li data-value=http://www.mamicode.com/"465">黄南</li>  
  558.                      <li data-value=http://www.mamicode.com/"466">果洛</li>  
  559.                      <li data-value=http://www.mamicode.com/"467">玉树</li>  
  560.                      <li data-value=http://www.mamicode.com/"468">海西</li>  
  561.                   </ul>  
  562.        </li>  
  563.            <li><div data-value=http://www.mamicode.com/"31">宁夏</div>  
  564.        <ul>  
  565.                      <li data-value=http://www.mamicode.com/"469">银川</li>  
  566.                      <li data-value=http://www.mamicode.com/"470">石嘴山</li>  
  567.                      <li data-value=http://www.mamicode.com/"471">吴忠</li>  
  568.                      <li data-value=http://www.mamicode.com/"472">固原</li>  
  569.                      <li data-value=http://www.mamicode.com/"473">中卫</li>  
  570.                   </ul>  
  571.        </li>  
  572.            <li><div data-value=http://www.mamicode.com/"32">新疆</div>  
  573.        <ul>  
  574.                      <li data-value=http://www.mamicode.com/"474">乌鲁木齐</li>  
  575.                      <li data-value=http://www.mamicode.com/"475">克拉玛依</li>  
  576.                      <li data-value=http://www.mamicode.com/"476">奎屯</li>  
  577.                      <li data-value=http://www.mamicode.com/"477">吐鲁番</li>  
  578.                      <li data-value=http://www.mamicode.com/"478">哈密</li>  
  579.                      <li data-value=http://www.mamicode.com/"479">昌吉</li>  
  580.                      <li data-value=http://www.mamicode.com/"480">博尔塔拉</li>  
  581.                      <li data-value=http://www.mamicode.com/"481">巴音郭楞</li>  
  582.                      <li data-value=http://www.mamicode.com/"482">阿克苏</li>  
  583.                      <li data-value=http://www.mamicode.com/"483">克孜勒苏</li>  
  584.                      <li data-value=http://www.mamicode.com/"484">喀什</li>  
  585.                      <li data-value=http://www.mamicode.com/"485">和田</li>  
  586.                      <li data-value=http://www.mamicode.com/"486">伊犁</li>  
  587.                      <li data-value=http://www.mamicode.com/"487">塔城</li>  
  588.                      <li data-value=http://www.mamicode.com/"488">阿勒泰</li>  
  589.                      <li data-value=http://www.mamicode.com/"489">石河子</li>  
  590.                      <li data-value=http://www.mamicode.com/"490">五家渠</li>  
  591.                   </ul>  
  592.        </li>  
  593.            <li><div data-value=http://www.mamicode.com/"33">台湾</div>  
  594.        <ul>  
  595.                      <li data-value=http://www.mamicode.com/"534">台北</li>  
  596.                      <li data-value=http://www.mamicode.com/"535">新北</li>  
  597.                      <li data-value=http://www.mamicode.com/"536">桃园</li>  
  598.                      <li data-value=http://www.mamicode.com/"537">台中</li>  
  599.                      <li data-value=http://www.mamicode.com/"538">台南</li>  
  600.                      <li data-value=http://www.mamicode.com/"539">高雄</li>  
  601.                   </ul>  
  602.        </li>  
  603.            <li><div data-value=http://www.mamicode.com/"34">香港</div>  
  604.        <ul>  
  605.                      <li data-value=http://www.mamicode.com/"540">中西区</li>  
  606.                      <li data-value=http://www.mamicode.com/"541">东区</li>  
  607.                      <li data-value=http://www.mamicode.com/"542">九龙城区</li>  
  608.                      <li data-value=http://www.mamicode.com/"543">观塘区</li>  
  609.                      <li data-value=http://www.mamicode.com/"544">深水埗区</li>  
  610.                      <li data-value=http://www.mamicode.com/"545">黄大仙区</li>  
  611.                      <li data-value=http://www.mamicode.com/"546">湾仔区</li>  
  612.                      <li data-value=http://www.mamicode.com/"547">油尖旺区</li>  
  613.                      <li data-value=http://www.mamicode.com/"548">离岛区</li>  
  614.                      <li data-value=http://www.mamicode.com/"549">葵青区</li>  
  615.                      <li data-value=http://www.mamicode.com/"550">北区</li>  
  616.                      <li data-value=http://www.mamicode.com/"551">西贡区</li>  
  617.                      <li data-value=http://www.mamicode.com/"552">沙田区</li>  
  618.                      <li data-value=http://www.mamicode.com/"553">屯门区 </li>  
  619.                      <li data-value=http://www.mamicode.com/"554">大埔区</li>  
  620.                      <li data-value=http://www.mamicode.com/"555">荃湾区</li>  
  621.                      <li data-value=http://www.mamicode.com/"556">元朗区</li>  
  622.                   </ul>  
  623.        </li>  
  624.            <li><div data-value=http://www.mamicode.com/"35">澳门</div>  
  625.        <ul>  
  626.                      <li data-value=http://www.mamicode.com/"557">花地玛堂区</li>  
  627.                      <li data-value=http://www.mamicode.com/"558">圣安多尼堂区</li>  
  628.                      <li data-value=http://www.mamicode.com/"559">大堂区</li>  
  629.                      <li data-value=http://www.mamicode.com/"560">望德堂区</li>  
  630.                      <li data-value=http://www.mamicode.com/"561">风顺堂区</li>  
  631.                      <li data-value=http://www.mamicode.com/"562">嘉模堂区</li>  
  632.                      <li data-value=http://www.mamicode.com/"563">圣方济各堂区</li>  
  633.                      <li data-value=http://www.mamicode.com/"564">路氹城</li>  
  634.                   </ul>  
  635.        </li>  
  636.            <li><div data-value=http://www.mamicode.com/"491">国外</div>  
  637.        <ul>  
  638.                      <li data-value=http://www.mamicode.com/"492">澳大利亚</li>  
  639.                      <li data-value=http://www.mamicode.com/"493">加拿大</li>  
  640.                      <li data-value=http://www.mamicode.com/"494">英国</li>  
  641.                      <li data-value=http://www.mamicode.com/"495">日本</li>  
  642.                      <li data-value=http://www.mamicode.com/"496">新加坡</li>  
  643.                      <li data-value=http://www.mamicode.com/"497">德国</li>  
  644.                      <li data-value=http://www.mamicode.com/"498">法国</li>  
  645.                      <li data-value=http://www.mamicode.com/"499">韩国</li>  
  646.                      <li data-value=http://www.mamicode.com/"500">比利时</li>  
  647.                      <li data-value=http://www.mamicode.com/"501">新西兰</li>  
  648.                      <li data-value=http://www.mamicode.com/"502">瑞典</li>  
  649.                      <li data-value=http://www.mamicode.com/"503">瑞士</li>  
  650.                      <li data-value=http://www.mamicode.com/"504">荷兰</li>  
  651.                      <li data-value=http://www.mamicode.com/"505">阿联酋</li>  
  652.                      <li data-value=http://www.mamicode.com/"506">芬兰</li>  
  653.                      <li data-value=http://www.mamicode.com/"507">丹麦</li>  
  654.                      <li data-value=http://www.mamicode.com/"508">泰国</li>  
  655.                      <li data-value=http://www.mamicode.com/"509">西班牙</li>  
  656.                      <li data-value=http://www.mamicode.com/"510">意大利</li>  
  657.                      <li data-value=http://www.mamicode.com/"511">挪威</li>  
  658.                      <li data-value=http://www.mamicode.com/"512">奥地利</li>  
  659.                      <li data-value=http://www.mamicode.com/"513">爱尔兰</li>  
  660.                      <li data-value=http://www.mamicode.com/"514">马来西亚</li>  
  661.                      <li data-value=http://www.mamicode.com/"515">尼日利亚</li>  
  662.                      <li data-value=http://www.mamicode.com/"516">俄罗斯</li>  
  663.                      <li data-value=http://www.mamicode.com/"517">巴西</li>  
  664.                      <li data-value=http://www.mamicode.com/"518">南非</li>  
  665.                      <li data-value=http://www.mamicode.com/"519">葡萄牙</li>  
  666.                      <li data-value=http://www.mamicode.com/"520">墨西哥</li>  
  667.                      <li data-value=http://www.mamicode.com/"521">印尼</li>  
  668.                      <li data-value=http://www.mamicode.com/"522">越南</li>  
  669.                      <li data-value=http://www.mamicode.com/"523">以色列</li>  
  670.                      <li data-value=http://www.mamicode.com/"524">科威特</li>  
  671.                      <li data-value=http://www.mamicode.com/"525">希腊</li>  
  672.                      <li data-value=http://www.mamicode.com/"526">匈牙利</li>  
  673.                      <li data-value=http://www.mamicode.com/"527">阿根廷</li>  
  674.                      <li data-value=http://www.mamicode.com/"528">印度</li>  
  675.                      <li data-value=http://www.mamicode.com/"529">柬埔寨</li>  
  676.                      <li data-value=http://www.mamicode.com/"530">菲律宾</li>  
  677.                      <li data-value=http://www.mamicode.com/"531">埃及</li>  
  678.                      <li data-value=http://www.mamicode.com/"532">土耳其</li>  
  679.                      <li data-value=http://www.mamicode.com/"533">其他</li>  
  680.                   </ul>  
  681.        </li>  
  682.     </ul>  

这个列表比较长,结构看明白就好

 

JS部分

 
  1. $("#current-area").click(function () {  
  2.             var that = this;  
  3.             $("#current-area-list").mobiscroll().treelist({  
  4.                 theme: "android-ics",  
  5.                 lang: "zh",  
  6.                 display: ‘bottom‘,  
  7.                 inputClass: ‘tmp‘,  
  8.                 headerText: ‘请您选择‘,  
  9.                 onSelect: function (valueText, inst) {  
  10.                     console.log(valueText);  
  11.                     var n = valueText.split(‘ ‘);  
  12.                     var m1 = $(this).children("li").eq(n[0]).find("div").html();  
  13.                     var m1_id = $(this).children("li").eq(n[0]).find("div").attr("data-value");  
  14.                     var m2 = $(this).children("li").eq(n[0]).find("li").eq(n[1]).html();  
  15.                     var m2_id = $(this).children("li").eq(n[0]).find("li").eq(n[1]).attr("data-value");  
  16.                     console.log(m1);  
  17.                     console.log(m2);  
  18.                     console.log(m1_id);  
  19.                     console.log(m2_id);  
  20.                     /*$.post("inc/person.org.php", {apart: "resume_base", current_area: m1+m2, current_areaPID: m1_id, current_areaCID: m2_id}, function (result) { 
  21.                         if (result == ‘ok‘) { 
  22.                             $(that).find(".mbase-menu-txt").html(m1+m2); 
  23.                         } 
  24.                         else { 
  25.                             error(‘网络繁忙,请您稍后再试‘); 
  26.                         } 
  27.                     });*/后端处理部分  
  28.                 }  
  29.             });  
  30.             $("input[id^=current-area-list]").focus();  
  31.         });  

其它的和单选文本的没什么区别,只是想说下这时候的valueText,它的值是这样的 2 6,意思就是第一项选择的元素所在位置,后面那个数字表示的是第二项选择的元素所在的位置。

至于三项选择的我还没用到,但应该是可以的,好久没写博客,可能写的很馄饨,有什么不明白的可以留言交流。

附上css、js文件:

http://pan.baidu.com/s/1i5qcrUt

http://pan.baidu.com/s/1bpC9g5p

mobiscroll日期选择插件移动端插件文本选择插件