I\'m having a little trouble figuring out a fast way to accomplish a (seemingly) simple task. Say I have the following html:
One>
Try the closest() function
http://docs.jquery.com/Traversing/closest#expr
This will give you the total number of ul parents:
var numofuls = $(this).parents('ul').length;