2

I have a jQuery drop down navigation that adjusts its width in accordance with the longest item in the list. This works perfectly in Firefox and Safari but for some reason in IE the width is extended the entire length of the page. If I set a fixed width the problem is sort of solved, however then I need to worry about updating the width as the items in the list change.

Is there a (simple) workaround for specifying a dynamically changing width in IE?

Thanks.

mjv
  • 73,152
  • 14
  • 113
  • 156
  • Related questions: http://stackoverflow.com/questions/682764/select-dropdown-with-fixed-width-cutting-off-content-in-ie, http://stackoverflow.com/questions/73960/dropdownlist-width-in-ie – kgiannakakis Sep 16 '10 at 14:13
  • i dont think he is actually using a dropdown. he is doing navigation, when have you seen someone use a dropdown for that? – mkoryak Sep 16 '10 at 14:15
  • if you are using a dropdown, you need to get a dropdown replacement or use the hack recommended in the first comment. here is a dropdown replacement you can use: http://programmingdrunk.com/current-projects/dropdownReplacement/#select – mkoryak Sep 16 '10 at 14:16

2 Answers2

1
width: auto;

should work, is that what you are using?

mkoryak
  • 57,086
  • 61
  • 201
  • 257
  • I was originally using a min-width of 1px but I just tested width: auto; and that produces the same 100% width problem in IE. – redletterday Sep 16 '10 at 14:16
0

Try a display: inline-block; on your ul or div or whatever contains the menu items.

Jacob
  • 77,566
  • 24
  • 149
  • 228