Bootstrap based on the Drop-down menu in the Computer browser can be used normally, in the mobile browser can pop-up Drop-down list, but can not select the menu items in the list, through their own Baidu to find the reason to bootstrap script file Ontouchstart replaced by Disable-ontouchstart can be resolved, and the replacement cannot be resolved. (Red meter Mobile UC Browser does not support, millet cell phone UC Browser normal, other temporarily not tested)
jquery:v1.11.2
bootstrap:v3.3.4
The following is the foreground page code:
<div class= "Input-group" >
<span class= "Input-group-addon" id= "Sizing-addon2" > This field benefits:</span>
<div class= "Btn-group" >
<button type= "button" class= "btn btn-default dropdown-toggle" id= "Btnfuli" Name= "Btnfuli" data-toggle= "dropdown" "value=" "
aria-expanded=" false ">
Please select this field benefit ... <span class=" caret " ></span>
</button>
<ul class= "Dropdown-menu" id= "Uifuli" role= "menu" >
<li> <a title= ' 1 ' href= ' # ' > local welfare </a></li><li class= ' divider ' ></li>
<li><a Title= ' 2 ' href= ' # ' > Field benefits </a></li><li class= ' divider ' ></li>
</ul>
< Input id= "Txtfuli" name= "this field benefit"/>
</div>
</div>
The following JS script: (Add click for Drop-down menu item)
Databindfuli:function () {
$ ("#UiFuLi li a"). Bind ("click", Function () {
var $this = $ (this);
var $a = $this. Parent (). Parent (). Prev ()
var t = $this. Text ();
$a. Val ($this. attr (' title '));
$ (' #txtFuLi '). Val ($this. attr (' title '));
$a. Text ($this. text ());
$a. Append ("<span class= ' caret ' >");}
The workaround looks like this:
The following code is not supported by the mobile browser, the following elements specified ID assignment can be resolved ()
$this. Parent (). Parent () prev ()
Adjusted code:
$ ("#drpWorkType li a"). Bind ("click", Function () {
var $this = $ (this);
var $a = $this. Parent (). Prev ()
$ (' #txtWorkType '). Val ($this. attr (' title '));
$ (' #btnWorkType '). Val ($this. attr (' title '));
$ (' #btnWorkType '). Text ($this. text ());
$a. Val ($this. attr (' title '));
$a. Text ($this. text ());
$a. Append ("<span class= ' caret ' >");
});
The above is a small set up to introduce the implementation of the bootstrap based on the Drop-down menu mobile phone can not choose the reason for the choice of items with a solution, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!