If that anchor has the class cross-link, than yes, what you have there is an infinite loop. Not sure what your trying to do, so the only thing I can recommend is remove that line. Though, that will kill all functionality entirely, if any. You would need to add a third condition to drop out a[href=#2] that element so that the trigger() isn’t executed again.