Stec Records Forum

Tools to make music

News: We are back.  We've updated the look of the forum with a new "theme" that works better on mobile devices. Also 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 2817 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.