how to hide scrollbar but still scroll css code example
Example 1: hide scrollbar css
.scrollbar-hidden::-webkit-scrollbar {
display: none;
}
.scrollbar-hidden {
-ms-overflow-style: none;
scrollbar-width: none;
}
Example 2: hide scrollbars
//Hides scrollbars but does not allow scrolling
body {
overflow-y: hidden;
overflow-x: hidden;
}
//Hides scrollbars but keep the ability to scroll
.example::-webkit-scrollbar {
display: none;
}
.example {
-ms-overflow-style: none;
scrollbar-width: none;
}
Example 3: javascript hide scrollbar
function HideScrollbar() {
var style = document.createElement("style");
style.innerHTML = `body::-webkit-scrollbar {display: none;}`;
document.head.appendChild(style);
}