I have created a Jquery toggle class function which adds and removes the class flipped
on a click eventListner. click here. At the moment this function is working when the user clicks on any of the elements wrapped in the .card
class. I when want to restrict where the user can click, therefore only allow the click function to work when the user clicks the .active-btn
.
I have made attempts to do this however once the card is flipped the active-btn
class doesn't seem to work. by the looks of things the 'front div' is sitting on top of the 'back div Below is a snippet of my code …
$('.active-btn').click(function(e){
e.preventDefault();
$card = $(this).closest('.card');
$('.flipped').not($card).removeClass('flipped');
$card.toggleClass('flipped');
});