Side menu transition with easing

Asked

Viewed 179 times

1

Hello! I want to put an "easing" effect to make more "smooth" the transition from the side menu that collects/expands on my site because when I click on the button to collect it only collects in thousandths of a second, with no effect.

Expanded:

inserir a descrição da imagem aqui

Collected:

inserir a descrição da imagem aqui

I made an example of how it is in this Website.

JS:

$("#sidebarToggle, #sidebarToggleTop").on('click', function(e) {
$("body").toggleClass("sidebar-toggled");
$(".sidebar").toggleClass("toggled"); }

CSS:

body.sidebar-toggled footer.sticky-footer {width: 100%;}

1 answer

0


In your ul <ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar"> place transition: 500ms all; and you will give a "attenuated" transition in the gathering of the side bar as you can see in the picture.

inserir a descrição da imagem aqui

  • Thank you, Hugocsl, thank you! Helped a lot ;) Just complementing if someone wants to use, add in the <ul> a Style, so: <ul class="navbar-Nav bg-gradient-Primary sidebar sidebar-dark accordion" id="accordionSidebar" style="Transition: 300ms all">

  • @Rogerwindberg without problems my dear, how nice that solved there, [s]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.