8

I am using bootstrap version 2.0

I have the following html structure -

Now when I click on the Filter by Team the dropdown shows properly. Now when I click on the link, I should be taken to the page. But the links do not work. I mean, when I click on the dropdown elements, they should take me to a url, which they are href'ed to, this does not happen.

<li style="margin-left: 12px;">
        <div class="dropdown" style="margin-top: 5px;">
          <a class="dropdown-toggle" style="margin-left: -2px;" data-toggle="dropdown" href="#">
            Filter by Team
          </a>
          <ul class="dropdown-menu" data-toggle="dropdown" role="menu" aria-labelledby="dropdownMenu">

            <li>
              <a tabindex="-1" class="disabled" href="/task/list/orgteam/8/">funvilla</a>
            </li>
            <li class="divider"></li>

            <li>
              <a tabindex="-1" class="disabled" href="/task/list/orgteam/6/">Dev Team</a>
            </li>
            <li class="divider"></li>

            <li>
              <a tabindex="-1" class="disabled" href="/task/list/orgteam/5/">Design Team</a>
            </li>
            <li class="divider"></li>


          </ul>
        </div>
      </li>

The fiddle can be found here - http://jsfiddle.net/ktgrw/

4

3 回答 3

17

问题是您为data-toggle设置了属性<ul>,该属性仅适用于您要打开/关闭下拉列表的链接,将其删除并且链接应该可以工作。

这是更新后的小提琴,带有正确的引导程序版本并删除了属性。

此外,disabled该类用于切换链接以防止打开下拉菜单,您应该将其从链接中删除,因为它没有任何实际用途。

于 2013-08-31T08:59:54.787 回答
0

链接工作得很好。当我们使用相对链接时,href="/task/list/orgteam/5/"我们需要确保我们在存在这些链接的网站上运行此页面。

为了清楚起见,我在这个新小提琴中添加了一个指向 google 的链接作为最后一个列表项(单击此处查看),因为它使用绝对 url href="http://www.google.com",所以它工作得很好。

于 2013-08-31T03:12:59.253 回答
0

I faced same problem with bootstrap framework and at the end got the solution (worked for me). Import all your required javascripts, mainly jquery.js .

于 2013-11-30T21:52:31.893 回答