I am adding an animation on div if image loading and I want to remove that class when image is loaded
<div class="card-image placeholder">
<a [routerLink]="somelink">
<img src="{{url}}/someimage"
onError="this.src='image';"
onload="this.removeClass='placeholder';">
</a>
</div>
Can you please give solution to remove class placeholder when image is loaded successfully
I found the solution to remove class placeholder
<div class="card-image placeholder">
<a [routerLink]="somelink">
<img src="{{url}}/someimage"
onError="this.src='image';"
onload="this.parentNode.parentNode.classList.remove('placeholder');">
</a>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With