Bootstrap 3 Dropdown Slidedown Strange Behavior when Navbar Collapsed

前端 未结 2 1804
说谎
说谎 2021-01-11 10:02

So I was adding some animations to the navbar dropdowns, but for some reason the most accepted answer (Adding a slide effect to bootstrap dropdown) seems to break or become

相关标签:
2条回答
  • 2021-01-11 10:23

    It's difficult without being able to inspect the elements but I have a hunch that your problem may lie with the container with the class "drowpdown-menu" (or whichever element actually has the scroll bar attached to it if it's not dropdown-menu). I don't think there's a problem with your jQuery but I would try adding a style to control the overflow property. Try setting it to hidden to force the box to go outside the bounds of the page. The main scroll should handle it from there. However from a UX point of view I would caution you on creating a menu with a lot of nesting which can result in a poor experience to the end user.

    0 讨论(0)
  • 2021-01-11 10:30

    $(document).ready(function(){
        $(".class-name").click(function(){
            $(".class-name").slideToggle(1000);//hear you can change value of slidetoggle i.e "slow","fast", or any number
        });
    });

    0 讨论(0)
提交回复
热议问题