问题描述:

Is it possible?

I tried the following code and it works. However, when the buttons are placed at different div's on the page, the menu is positioned at the wrong places.

<button class="btn btn-default" data-toggle="dropdown" data-target="#menu">Hello1</button>

<button class="btn btn-default" data-toggle="dropdown" data-target="#menu">Hello1</button>

<div class="dropdown">

<ul class="dropdown-menu" role="menu" id="menu">

<li>Hi</li>

</ul>

</div>

http://jsfiddle.net/isherwood/mE62z/

网友答案:

It doesn't look like Bootstrap accommodates this. Cloning might work:

http://jsfiddle.net/isherwood/mE62z/5

$('#menu').clone().attr('id','menu2').appendTo('body');
$('#menu2').addClass('pull-right');
相关阅读:
Top