This particular problem:
Try rethinking the logic slightly, and make the noDelay
actually effect the delay.
$(element).find("." + options.class).fadeOut(noDelay ? 0 : 'normal').remove();
Though I'm not sure if remove()
is necessary.
When I was doing fadeOut()
tests for another question, it seemed to hide and collapse the element. remove()
would completely remove the element from the DOM, but I'm not sure it is necessary if you just want to make it disappear from the document and have it stop effecting document flow (no gap where it was).
Real goal:
Also, it looks like you're planning to wrap jQuery. You'll end up wrapping code like this:
$("someElement").find(".someClass").fadeOut().remove();
...and changing it to something like:
fadeOut("someElement", { "class" : "someClass" });
...or:
var element = new SomeClass("someElement");
element.options.class = "someClass";
element.fadeOut();
Unless you're planning on reusing that particular element a lot, I think you're going to be wasting your time. jQuery has pretty efficient syntax for one-off operations, and you can always store matched elements in a temporary variable.
If you have some other purpose in mind that I'm missing, please excuse this intrusion on your design :)