arielsalminen / TinyNav.js

Responsive navigation plugin that weighs just 443 bytes
http://tinynav.viljamis.com/
635 stars 207 forks source link

Selected class is incorrect if "li" container does not have an "a" tag #59

Closed daminloi closed 10 years ago

daminloi commented 11 years ago

<ul> <li><a href="link1" class="inactive">link 1</a></li> <li>This has no link</li> <li class="selected"><a href="link2" class="active">link 2</a></li> <li><a href="link3" class="inactive">link 3</a></li> </ul>

So I have jQuery that appends the "selected" class to the parent li where the child has the class "active."

I then apply TinyNav to the list. However instead of link 2 being selected, link 3 is selected in the select drop down. I think having no link in the second li tag causes some kind of logic error. A work around is to insert some kind of dummy <a> tag but that shows an empty row in the select drop down when it is created.