change scrollbar color
.scrollable-element {
scrollbar-color: red yellow; /* red is for the thumb and yellow is for the track */
}
change scrollbar color
.scrollable-element {
scrollbar-color: red yellow; /* red is for the thumb and yellow is for the track */
}
change header background color on scroll css
/*
.active { background-color: #fff}
*/
$(function() {
$(window).on("scroll", function() {
if($(window).scrollTop() > 50) {
$(".header").addClass("active");
} else {
$(".header").removeClass("active");
}
});
});
how to change background color on scroll
const [red, green, blue] = [69, 111, 225]
const section1 = document.querySelector('.section1')
window.addEventListener('scroll', () => {
let y = 1 + (window.scrollY || window.pageYOffset) / 150
y = y < 1 ? 1 : y // ensure y is always >= 1 (due to Safari's elastic scroll)
const [r, g, b] = [red/y, green/y, blue/y].map(Math.round)
section1.style.backgroundColor = `rgb(${r}, ${g}, ${b})`
})
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us