Skip to content

Tag: javascript

Javascript attempt to keep sidebar at 100vh at all times

Working on a project requiring old-school CSS support and want to keep <aside> filling up the page by remaining the same height as the <article> element’s box (It may be between a header and footer, in which case it would not extend past them.) Here’s my attempt at dynamically setting …

How do I replace a class for a child element?

I have a piece of code that, while it works perfectly elsewhere, is not working when I try to apply it to a child element. I am trying to simply replace a class in the classList for an i element when the addEventListener(“mouseover” for the parent tag is triggered. Here’s my code: This shoul…

Prevent click event in Vue conditonally

I am disabling document body scroll when my mobile nav is open which is working as expected. However it was not removing the overflow hidden when user would click a link to another route/page. I created a simple method to remove the overflow hidden when a link is clicked in the nav when the menu is open, whic…