change scrollbar color code example
Example 1: change scrollbar color
.scrollable-element {
scrollbar-color: red yellow;
}
Example 2: javascript on scroll change nav color
$(function () {
$(document).scroll(function () {
var $nav = $(".navbar-fixed-top");
$nav.toggleClass('scrolled', $(this).scrollTop() > $nav.height());
});
});
Example 3: scrollbar with 2 different colors on same page css
::-webkit-scrollbar-track {
background-color: #333;
}
div::-webkit-scrollbar-track {
background-color: #b13131;
}