自动关闭=" outsideClick"平板电脑不起作用

时间:2015-11-16 07:52:53

标签: angularjs drop-down-menu dropdown

我有以下代码:



<!DOCTYPE html>
<html>

  <head>
    <link data-require="bootstrap@*" data-semver="3.3.2" rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
    <script data-require="angular.js@*" data-semver="1.3.9" src="https://code.angularjs.org/1.3.16/angular.js"></script>
    <script src="ui-bootstrap.js"></script>
    <link rel="stylesheet" href="style.css" />
    <script src="script.js"></script>
  </head>

  <body ng-app="app">
    <span class="dropdown" dropdown auto-close="outsideClick" dropdown-append-to-body>
      <a href="javascript:void(0);" class="dropdown-toggle" dropdown-toggle>
        Click me for a dropdown, yo!
      </a>
      <ul class="dropdown-menu">
        <li>Element 1</li>
        <li>Element 2</li>
      </ul>
    </span>
  </body>

</html>
&#13;
&#13;
&#13;

自动关闭=&#34; outsideClick&#34;平板电脑不起作用。我该怎么办?

基本上,我正在尝试这样做:

&#13;
&#13;
<div class="col-sm-2 col-md-2 col-lg-2 btn-group " dropdown dropdown-append-to-body
                auto-close="outsideClick">
                <button id="btn-append-to-body" type="button" class="btn btn-primary " dropdown-toggle>
                   abcd
                    <span class="caret caret-span"
                        ></span>
                </button>
                <ul class="dropdown-menu dropdown-label" role="menu" aria-labelledby="btn-append-to-body"
                    >
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

添加下拉菜单以及下拉菜单。

https://github.com/angular-ui/bootstrap/issues/4444

<强>更新

关于您的更新,您可能需要小心地将col-样式混合到相同的下拉指令。

我假设您使用的是angular-ui bootstrap

您的代码似乎与文档不符。我想也许你正在混合bootstrapangular-ui bootstrap

请阅读:

下拉菜单下的

http://angular-ui.github.io/bootstrap/