sebnitu / HorizontalNav

A jQuery plugin that spans a horizontal navigation to fit the full width of it's container.
MIT License
277 stars 43 forks source link

Can't you just use display:table? #1

Closed hitsthings closed 12 years ago

hitsthings commented 12 years ago

I might be misunderstanding, but I believe this can be done with pure CSS.

ul.full-width { display: table; width: 100%; }

ul.full-width > li { display: table-cell; }

This should work in IE8+, FF/Chrome/Safari. I'd expect it'd work in Opera too.

The JS options could be a good polyfill for older browsers though.

Am I misunderstanding something about this plugin?

sebnitu commented 12 years ago

Yup, you're absolutely correct. I still work on a lot of sites that need to have IE7 support however so this plugin is more of a catch all in that regards. But definitely, if you don't have to worry about IE7, then the pure CSS method would work much better.

Thank you for pointing this out. I'll add this bit of detail to the docs with your credit in the next update :)

hitsthings commented 12 years ago

Cool yeah it definitely is useful for IE7 support. Thanks for writing it!