I have this
if(noDelay){
$(element).find("." + options.class).remove();
} else {
$(element).find("." + options.class).fadeOut().remove();
}
Is there a way I could avoid repeating the sentence and only add the fadeOut() when a given condition is met?
I can’t move fadeOut() till the end of the chain, which probably would’ve made things easier.
I’m thinking something like
$(element).find("." + options.class).(if(noDelay) fadeOut()).remove();
Thanks in advance,
Leo
There is nothing documented like you want but maybe this will work for you:
Why 400, because the default duration for fadeOut is 400 milliseconds. (from documentation)