单击

时间:2016-11-09 21:14:22

标签: html5 twitter-bootstrap css3

当我点击正文或导航栏时,如何防止下拉消失?

这是我目前的HTML:

<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
  <ul class="nav navbar-nav">
    <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
    <li><a href="#">Link</a></li>
    <li class="dropdown">
      <a href="#" class="dropdown-toggle" 
         data-toggle="dropdown" role="button" aria-expanded="false">
           Dropdown <span class="caret"></span>
      </a>
      <ul class="dropdown-menu" role="menu">
        <li><a href="#">Action</a></li>
        <li><a href="#">Another action</a></li>
        <li><a href="#">Something else here</a></li>
      </ul>
    </li>
  </ul>
</div>

1 个答案:

答案 0 :(得分:2)

来自Keep Bootstrap Dropdown Open When Clicked Off的KyleMit解决方案:

public boolean isValid(double value){
    if (value < 0.0) {
        System.out.println("Invalid Input");
        return false;
    }else {return true;}
}