Is there a way to create a toggle that changes both the height and width of an element when it is clicked?
<div class="flexbox-container" id="main" onclick="staybig()">Create Account</div>
.flexbox-container {
transition: height 0.5s, width 0.5s;
height: 100px;
width: 100px;
display: flex;
justify-content: center;
text-align: center;
align-items: center;
background-color: #492ee4;
border-radius: 50%;
display: flex;
margin: auto;
margin-top: 200px;
}
let isBig = false
if (isBig) {
main.style.width = "100px";
main.style.height = "100px";
isBig = false
} else {
main.style.width = "113px";
main.style.height = "113px";
isBig = true
}
I have tried implementing this code but it does not produce the expected results. Can anyone provide assistance on how to fix this issue? Thank you.