Hello!!!
There is this HTML code:
<div class="wrapper"> <figure class="effect"> <img src="img"/> <figcaption> <h2>Lorem ipsum dolor sit amet.</h2> <p>Lorem ipsum dolor sit amet, consectetur......</p> <a href="#">View more</a> </figcaption> </figure> <figure class="effect"> <img src="img"/> <figcaption> <h2>Lorem ipsum dolor sit amet.</h2> <p>Lorem ipsum dolor sit amet, consectetur ......</p> <a href="#">View more</a> </figcaption> </figure> <figure class="effect"> <img src="img"/> <figcaption> <h2>Lorem ipsum dolor sit amet.</h2> <p>Lorem ipsum dolor sit amet, consec........</p> <a href="#">View more</a> </figcaption> </figure> </div>
As in jquery, you can implement the following:
- when clicking on the
<figure class="effect"> link that is a descendant of this <figure class="effect"> , the class <active> should be added; - at the same time, it turns out that the
<active> class should be added only where it is clicked.