jquery-archive / jquery-mobile

jQuery Mobile Framework
https://jquerymobile.com
Other
9.69k stars 2.41k forks source link

navbar with only one li #1154

Closed dannyc closed 13 years ago

dannyc commented 13 years ago

When using the navbar in the header with only a single li element, returns an error: "Uncaught Syntax error, unrecognized expression: :nth-child" This is using jquery mobile alpha 3 (1.0a3), with jquery 1.5. Code to reproduce:

Navbar test

header

While the navbar might have been intended for multiple li, no reason it should not support only one as well, or some-type of graceful alternative.

micahlmartin commented 13 years ago

This is broken for me too. Doesn't matter whether it's in the header or not. Any navbar ul that only contains 1 li throws the Uncaught Syntax error, unrecognized expression: :nth-child in all browsers except chrome. The correct behavior should be to just expand the bottom across the whole navbar.

toddparker commented 13 years ago

Yep, this is a bug being tracked already in #1107. Just curious, when would you use a navbar with a single item?

dannyc commented 13 years ago

I am using it on a dynamic (jsp) page where different potential links are available. Usually there are 2 or 3 but there are scenarios where only one link should be available. Agreed, if it was always only one link I would have chosen a different display method. For consistency sake we want the same look and feel for links even if it's only one. Thanks for your attention! (btw, gotta throw this in there even if it's not the forum for it- Bosses love the multi-platform native feel that works with old-legacy jsp code! In two weeks I was able to create a working prototype that they are already using in marketing)