const movingCarSection = document.querySelector(".hidden");
const movingCarsOptions = {
rootMargin: "5px 0px 0px 0px"
}
const movingCarsObservers = new IntersectionObserver(function(
entries,
movingCarsObservers
) {
entries.forEach(entry => {
if(!entry.isIntersecting){
movingCarSection.classList.add("show");
} else {
movingCarSection.classList.remove("show");
}
});
}, movingCarsOptions);
movingCarsObservers.observe(movingCarSection);
const movingCarSection = document.querySelector(".hidden");
const movingCarsOptions = {
rootMargin: "5px 0px 0px 0px"
}
const movingCarsObservers = new IntersectionObserver(function(
entries,
movingCarsObservers
) {
entries.forEach(entry => {
if(!entry.isIntersecting){
movingCarSection.classList.add("show");
} else {
movingCarSection.classList.remove("show");
}
});
}, movingCarsOptions);
movingCarsObservers.observe(movingCarSection);