Weird question:
I am in the process of creating a simple, CSS3-animated slideout panel. The animations are triggered using jQuery. I have two versions, one that works, and one that doesn't.
FIDDLE to the working version.
Code of the dysfunctional version:
$('.mark').click(function () {
$('.box').addClass('box-up');
$('.box').removeClass('box-down');
$(this).addClass('active');
$(this).removeClass('inactive');
});
$('.active').click(function () {
$('.box').addClass('box-down');
$('.box').removeClass('box-up');
$(this).addClass('inactive');
$(this).removeClass('active');
});
This is the jQuery I would like to work, unfortunately it doesn't. The intended result of the second version is to allow the user to click the <div class="mark"></div> to open and close the slideout panel.
What am I doing wrong? Any help would be greatly appreciated.