$('#buttons1').on('click', function(event) {
$('#button1content').toggle('show');
var wasVisible = $("#button1content").is(":visible");
if(!wasVisible) {
$("#buttons1").css("opacity", "0.5");
}
});
Toggle works perfectly fine, but whatever is inside the if statement doesn't get executed when #button1content is no longer visible. boo. It could be another part of my code that is messing it up, but I only want to know if there is anything wrong with this.
'slow'vs.'show'? If that's not meant to be aduration,.toggle()can be called without arguments to change whether the element is showing or hiding.