First of all, it seems you copyied the jquery without the function, so that isnt the problem:
nav.find("li").each(function(){
I think the problem is, that you travel to deep, so try this:
$(this).find(">ul")
or this:
$(this).children("ul")
From jQuery:
The .children()
method differs from .find()
in that .children()
only travels a single level down the DOM tree while .find()
can traverse down multiple levels to select descendant elements (grandchildren, etc.) as well.