Triggering Function When Page Gets Past Certain Size
Unanswered
Giant panda posted this in #help-forum
Giant pandaOP
How would I trigger a function when the page gets past a certain size?
This is as part of me making my app responsive, and implementing a hamburger menu for the header. Because I'm only conditional CSS right now, when the page gets resized from small to large with the hamburger menu still 'open', these styles don't reset.
This is as part of me making my app responsive, and implementing a hamburger menu for the header. Because I'm only conditional CSS right now, when the page gets resized from small to large with the hamburger menu still 'open', these styles don't reset.
1 Reply
Tonkinese
window.addEventListener("resize", (e) => window.innerWidth >= yourBreakpoint ? doSomething() : {})