Topic: open side-nav = body scroll-y:hidden and open side-nav = body scroll-y:auto

Kalubeticismo pro asked 5 years ago


Hello, how can I remove the scroll to the body when the sidenav opens? And when closing the sidenav to return scroll to the body? I don´t know which is the function or the class that causes the sidenav to close; thank you


Marta Wierzbicka staff answered 5 years ago


Hi,

please, create a snippet showing your problem here: https://mdbootstrap.com/snippets/. I'll try to help you.

Best,


Kalubeticismo pro commented 5 years ago

Hi Marta, thank you To OPEN sidenav the function is: var sideNavScrollbar = document.querySelector ('. custom-scrollbar');Ps.initialize (sideNavScrollbar);

What is the function to close sidenav?I need this function to make when closing sidenav to scroll to the body of my page


Bartłomiej Malanowski staff commented 5 years ago

I think you're looking for SideNav jQuery methods: https://mdbootstrap.com/docs/jquery/navigation/sidenav/#jQueryMethods



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.6.1
  • Device: PC
  • Browser: chrome
  • OS: Windows10
  • Provided sample code: No
  • Provided link: No