Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap dropdownlist z-index displaying under modal window footer

I am having some styling problems with bootstrap.

I have a small modal window containing a dropdown. However I can't seem to get the dropdown to display over the footer of the window.

I have played with the zindex of the dropdown ensuring it was higher than the windows but no luck.

Can anyone suggest what I should be changing?

The html

<div class="modal hide fade" id="store-modal">
<div class="modal-header">
    <h3 id="reward-title">Select Store</h3>
</div>
<div class="modal-body">
    <p>
        Please select the store you are working from
            <div class="btn-group">
                <a class="btn dropdown-toggle" data-toggle="dropdown" href="#">Select<span class="caret"></span></a>
                <ul class="dropdown-menu">
                    @foreach (var model in Model)
                    {
                        <li>
                            <a href="#" class="store" data-id="@Html.DisplayFor(modelItem => model.StoreId)">@Html.DisplayFor(modelItem => model.StoreName)</a>
                        </li>
                    }
                </ul>
            </div>

    </p>
</div>
<div class="modal-footer">
</div>

enter image description here

like image 650
Diver Dan Avatar asked Jan 11 '13 08:01

Diver Dan


1 Answers

You just add a class having z-index as attribute having higher than model box footer.

For z-index to work, you also have to set position = relative, absolute, or fixed. Also putting z-index something like 5000 might help. (the modal may have z index higher than the 2000's.

so in your css i would add this:

.class-of-dropdown {
    position: relative;
    z-index: 5000;
}

.modal-body class has a overflow-y: auto property. You might need to change this to:

.modal-body {
    overflow-y:visible;
}
like image 175
Rubyist Avatar answered Sep 21 '22 07:09

Rubyist