I’m wondering if these two expressions are equivalent, because if they are, it would make this much easier.
$('div', this).filter(':not(.trigger)')...
$('div:not([class*=trigger])', this)...
(this providing a context under which to look for the specified div)
They’re not essentially the same. The second also filters out all div’s which have a class which contains “trigger” in the name, thus also e.g. “anothertrigger” and “triggerfoo”.
You can also use
which is imho much clearer.