Stec Records Forum

Tools to make music

News: Note that we check all new user requests for spam violations. If you believe you have been rejected unfairly please contact us and we will attempt to resolve it with you. - Stecrew

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

  • Administrator
  • Hero Member
  • bob
  • Posts: 773
  • 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.