Hello there! I’m trying to setup a new team page for our company website. Basically, I have a full width column that I’d like to resize to 50% when a modal is toggled on, and vice versa. I am still new to JS, and I’m not sure at this point what the issue could be. This is the code I’m using already (That isn’t working):
const bioColumn = document.getElementById('bio-row').getElementsByClassName('bio-column');
document.getElementsByClassName('x-anchor-toggle bio-modal').onclick = widthToggle;
function widthToggle() {
if (bioColumn.classList.contains('bio-width')){
bioColumn.classList.remove('bio-width');
}
else {
bioColumn.classList.add('bio-width');
}
}
Is there an easier way to accomplish this?
Here is a link to the page I’m editing this on: https://wordpress-669672-2268259.cloudwaysapps.com/ashleys-test-page/