2
I have the following problem:
by clicking on the dropdown button inside a div with overflow property: Hidden it opens, but gets cropped. Example:
HTML
<div class="scroll">
<div class="out_element">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle">
Ação <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#">Ação</a></li>
<li><a href="#">Outra ação</a></li>
<li><a href="#">Algo a mais aqui</a></li>
<li class="divider"></li>
<li><a href="#">Link separador</a></li>
</ul>
</div>
</div>
<div class="out_element">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle">
Ação <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#">Ação</a></li>
<li><a href="#">Outra ação</a></li>
<li><a href="#">Algo a mais aqui</a></li>
<li class="divider"></li>
<li><a href="#">Link separador</a></li>
</ul>
</div>
</div>
<div class="out_element">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle">
Ação <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#">Ação</a></li>
<li><a href="#">Outra ação</a></li>
<li><a href="#">Algo a mais aqui</a></li>
<li class="divider"></li>
<li><a href="#">Link separador</a></li>
</ul>
</div>
</div>
<div class="out_element">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle">
Ação <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#">Ação</a></li>
<li><a href="#">Outra ação</a></li>
<li><a href="#">Algo a mais aqui</a></li>
<li class="divider"></li>
<li><a href="#">Link separador</a></li>
</ul>
</div>
</div>
<div class="out_element">
<div class="btn-group">
<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle">
Ação <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="#">Ação</a></li>
<li><a href="#">Outra ação</a></li>
<li><a href="#">Algo a mais aqui</a></li>
<li class="divider"></li>
<li><a href="#">Link separador</a></li>
</ul>
</div>
</div>
</div>
CSS
body{
height: 2000px;
}
.scroll{
white-space: nowrap;
width: 100%;
overflow: auto;
margin-top:100px;
}
.out_element{
width: 200px;
height: 100px;
border: 1px solid #000;
margin: 10px;
display: inline-block;
}
ul.dropdown-menu{
position:fixed;
overflow:visible;
}
http://jsfiddle.net/VVVBk/3/ - Complete structure: http://jsfiddle.net/VVVBk/5/
How to solve this?
PS: I’m wearing a bootstrap;
No direct solution with CSS. A
div
father withoverflow:hidden
will always cut the child elements.– Kazzkiq
I understand @Kazzkiq - I had to use the abfurlan solution, gave it right!
– Jefferson Alison