That code is for something you can stick in the HTML file in the Advanced Layout Options. It requires you to do some custom coding particularly in the "Layout file" of the Advanced Layout options.
This is probably easiest for someone that understands code to wrap this around the entire menu block in the HTML file however if you don't know code you can do the following.
Go to Admin and Menu Administration.
Every menu and sub menu item as a "Minimum Rank to View" dropdown. If you change this from Everyone to the lowest rank on your site you will accomplish the same thing. A little more work but less code to mess with. Seems to work ok with custom layouts as well.
--
Six Demon BagJack Burton: Hey, what more can a guy ask for?
Egg Shen: Oh, a six-demon bag!
Jack Burton: Terrific, a six-demon bag. Sensational. What's in it, Egg?
Egg Shen: Wind, fire, all that kind of thing!