I have a div with it's style class. I define it's style as follow.
.widgetContainer:hover{
border-radius: 0rem;
top: 0rem;
left: 0rem;
height: 100%;
width: 100%;
}
And in JS I define a method for a click event.
exitWidget(event){
if(event.target === document.getElementsByClassName("widgetContainer")[0])
{
document.getElementsByClassName("widgetContainer")[0].style.height = "3rem";
document.getElementsByClassName("widgetContainer")[0].style.width = "3rem";
}
}
The CSS style and the event do what is expected. The problem is when I hover the div again after the event. The properties height and width don't grow to fill the screen. It's like JS overrided the CSS properties. Is there something I'm missing?