Stec Records Forum

Tools to make music

News: Note that we've improved the security of the forum by enhancing the sign up form.

IE bug on ordered list when using display show and hide it (Read 2738 times)

  • Administrator
  • Hero Member
  • Chief Administrator
  • Posts: 771
  • Karma: +0/-0
  • Time reveals truth.
    • Bob Sellon's Home Page
If you use the "display" css property of a div wrapped around an ordered list (ol) to show or hide it, on Internet Explorer 9 or less the numbers all get set to 0 when the wrapper div (or whatever tag) is "turned back on".  For instance:

1. Item 1
2. Item 2
3. Item 3

becomes

0. Item 1
0. Item 2
0. Item 3

They finally got it sorted out with IE 10 and there are some suggested work-arounds (http://stackoverflow.com/questions/5584500/ordered-list-showing-all-zeros-in-ie9) but code can get confusing enough without a lot of special cases so as a general rule I try to avoid special cases and consider other solutions. In my case I was creating the list dynamically using Javascript and had the numbers available (I was just being lazy) so I could just explicitly plunk them into the code and use an unordered list, table or div.

It's a bitch to give up a feature like ordered lists but there are a lot of other ways to do it that don't pollute your code so it's worth thinking about.