Generation

generate functionFri, 17 Feb 2023

an active div alaways on top of screen

var topDiv = document.getElementById('top'); window.onscroll = function(e) { window.scrollY > 0 ? topDiv.classList.add('top-active') : topDiv.classList.remove('top-active'); }

TypeScript
Generate More

Questions about programming?Chat with your personal AI assistant