Forum

bootstrap - individ...
 
Powiadomienia
Wyczyść wszystko

bootstrap - individual element dropdown

1 Wpisy
1 Użytkownicy
0 Reactions
717 Widoki
0
Rozpoczynający temat

how to

1 odpowiedź
0
Rozpoczynający temat

example html code

<li>
		<div class="dropdown" >
			<button type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
				menu
			</button>
			<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
				<a class="dropdown-item" href="#">Option one</a>
				<a class="dropdown-item" href="#">Option two</a>
				<a class="dropdown-item" href="#">Option three</a>
			</div>
		</div>
</li>

javascript

$(function () {
    $('.dropdown').on('show.bs.dropdown', function() {
        $('body').append($(this).find('.dropdown-menu').css({
            position: 'absolute',
            left: $(this).offset().left,
            top: $(this).offset().top
        }).detach());
    });
});	

with context to body (z-index issue fix)

Twoja odpowiedź

Nazwa autora

E-mail autora

Twoje zapytanie *

 
Podgląd 0 rewizje Zapisano
Udostępnij: