Is there a way to dynamically add a class to an img
element for animation purposes, based on the parent of 'image-reveal-check' having an active class?
To clarify: The parent class does not always have 'active', it is only added when the element comes into view.
HTML Code Snippet
<div class="active">
<div class="image-reveal-check">
<div class="image-reveal-inner">
<img>
</div>
</div>
</div>
jQuery Code Snippet
if ($(".image-reveal-check").parent().hasClass('active')) {
$(".image-reveal-inner img").addClass('image-reveal-start');
}