I was wondering if I really have to write:
if (status) {
$('#status-image-' + id).fadeIn();
} else {
$('#status-image-' + id).fadeOut();
}
or there is a function to which I can provide my boolean status, something like:
$('#status-image-' + id).fade(status);
I’ve seen fadeToggle, but it doesn’t accept a boolean status parameter.
No, there is not, but you can make one like that:
and then call it like that (see this jsfiddle for a proof):
Is it what you wanted?