Mobile phone end of the selection box Mobileselect.js use
File Address: Https://github.com/onlyhom/mobileSelect.js
Please download for your own interest
Use procedure
1 Introducing Tags
<link rel="stylesheet" type="text/css" href= "css/mobileselect.css" >
<script src="js/mobileselect.js" type="Text/javascript" ></script>
What I'm introducing here is that the Mini actually uses the same
2 Data initialization
//Get logistics Company Information $delivery=model (' Delivery '); $expressComList=$delivery-Expressname; $data=Array(); $i=0; foreach($expressComList as $k=$v){ $data[$i[' ID ']=$k; $data[$i[' Value ']=$v; $i++; } $this->assign (' Expresscomlist ', Json_encode ($data));
3 linkage using a normal array
< P >< type= "text" ID= "Express_trigger" name= "Express_name" class= "placeholder_99" placeholder= "logistics company"/></ p>
JS function Section
var mobileselect =new Mobileselect ({trigger:'#express_trigger', Title:'Individual Selection', Wheels: [{data:{$expressComList}}], position:[2],//Initialize positioningCallbackfunction(Indexarr, data) {mobileselect.position=[Indexarr]; $('#express_code'). Val (data[0].ID); $('#express_trigger'). Val (data[0].value); } });
4 The rest is to get the data that this article does not describe
Mobile phone end of the selection box Mobileselect.js use