I am wondering if anyone has found a way to pin the side menu bar and the top header so that they are always visible when you scroll down a form page. I am using the card style template for my app pages.
Hi guys, sorry for digging up this old topic, but I don’t know how to make Sidebar sticky. I know I just need to add some CSS like Fixed or Sticky, but I’m not sure where to add it. I use the Classic theme. Here the CSS related to Sidebar that I found (what should I change specifically?):
Ah ok I’m sorry maybe I don’t fully understand this thread. What I’m asking is make the side bar always visible on scrolling. At the moment if I scroll down the main page the side bar is also scrolled down, which make the nav and other items there invisible. How can I make the side bar sticky when the main page is scrolled?
in the dashboard.html between the script tags you could add
// Get the offset position of the navbar
var navHeight = $('.nav')[0].scrollHeight
var sidebar = $(".sidebar")[0]
// When the user scrolls the page, make the sidebar sticky
window.onscroll = function() {
if (window.pageYOffset >= navHeight) {
sidebar.classList.add("sticky")
} else {
sidebar.classList.remove("sticky");
}
};