You need to check if all examples are closed in the complete function of the slideToggle
$(this).closest('.example').find('.content').slideToggle(500, function() {
// check if any example is active
if(!$('.example').hasClass('active')) {
$('.example').css('opacity', '1');
}
});
I also cleaned it up a bit caching some jquery elements