My markup includes two classes, fade-item
and fade
. The fade
class is nested within the fade-item
class as shown below:
<a class="product-item fade-item" (mousemove)="hoverOn(i)" (mouseleave)="hoverOff(i) >
<div class='fade' *ngIf='item.active' >
<button class="botonete botonete--primary botonete--hero-one">
Button Text
</button>
</div>
</a>
When hovering over the fade-item
element with the mousemove
event, a value is set on the item causing it to display using *ngIf='item.active'
, but the expected opacity transition is not taking place.
The CSS code for this scenario is provided below:
.fade {
opacity: 0;
transition: opacity 1s ease-in-out;
-moz-transition: opacity 1s ease-in-out;
-webkit-transition: opacity 1s ease-in-out;
}
.fade-item:hover {
.fade{
opacity: 1;
}
}
I am having trouble figuring out what I might be doing wrong. Can anyone offer some insight?