Would it instead be an idea to use $.parentsUntil(), to find the parent that matches what you are looking for?
One more stacking parent.
Hmm, another stacked parent()
ack. +1
Looks good to me.
Many thanks!