Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Disable second button onclick event, if first button is clicked. Re: Disable second button onclick event, if first button is clicked.

#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’.