1

I have auto generated ul li CMS menu (prestashop) and I need to distinguish which li items have another's descendants(sub-levels) and which haven't and distinguish their css to let people know which items contain another's items.

I wanted to do it through jQuery, but I can't figure out how to do that.

user2061853
  • 627
  • 1
  • 7
  • 11

1 Answers1

0

In jQuery you could do:

jQuery('.sf-menu li').has('ul').addClass('has-submenu');

This will add the class has-submenu to all li elements with an ul inside. You can see how it works in the following fiddle http://jsfiddle.net/59GFr/1/

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459