Home › Forums › CSS › Disable second button onclick event, if first button is clicked. › Re: Disable second button onclick event, if first button is clicked.
April 21, 2013 at 11:39 am
#132601
CrocoDillon
Participant
I’d do something like (assuming jQuery):
var current;
$(‘.first’).click(function() {
if (current == null) {
current = this;
// start animation
} else if (current == this) {
// undo animation
current = null;
}
});
// same with $(.second’)
Storing the Element that was clicked as reference so you know what animation is ‘active’.