(solved) IE6 slidetoggle bug. Solutions?

(solved) IE6 slidetoggle bug. Solutions?

I'm having a problem with nested slide toggles in IE6. When the element slides out, part or all of the text will turn invisible. I can make it visible by highlighting the text. It works fine for all other version of IE and other browser (of course) Unfortunately my clients are going to have a lot of IE6 computers.

A picture of the problem


A picture after the text is selected.


HTML

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  2. <html>
  3. <link rel="stylesheet" type="text/css" href="/css/redmond/jquery-ui-1.8.2.custom.css" />
  4. <link rel="stylesheet" type="text/css" href="/test.css" />
  5. <script src="/jquery-1.4.2.js" type="text/javascript"></script>
  6. <script src="/js/jquery-ui-1.8.2.custom.min.js"></script>
  7. <body>
  8. <div class="collapseBox" id="employees">
  9. <h1>Hit Me</h1>
  10. <div style="clear: both;"></div>
  11. <p>
  12. Here is some text <br />
  13. Just to play <br />
  14. Lets see if it will work <br />
  15. </p>
  16. </div>
  17. <div class="collapseBox" id="people">
  18. <h1>Hit Me</h1>
  19. <div style="clear: both;"></div>
  20. <p>
  21. Here is some text <br />
  22. Just to play <br />
  23. Lets see if it will work <br />
  24. </p>
  25. <div class="collapseBox" id="people">
  26. <h1>Hit Me</h1>
  27. <div style="clear: both;"></div>
  28. <p>
  29. Here is some text <br />
  30. Just to play <br />
  31. Lets see if it will work <br />
  32. </p>
  33. </div>
  34. </div>
  35. <script>
  36. $(document).ready(function (){
  37. $('<button>+</button>').insertAfter('div.collapseBox h1');
  38. $('div.collapseBox div').nextAll().slideUp('fast');
  39. $('div.collapseBox button').click(function () 
  40. var item = $(this);
  41. if (item.text() == "+")
  42. item.text('-');
  43. else
  44. item.text('+');
  45. item.next().nextAll().slideToggle('fast');
  46. });
  47. if ($.browser.msie && $.browser.version < 8)
  48. $('div.collapseBox h1').css({'float': 'left'});
  49. });
  50. </script>
  51. </body>
  52. </html>

CSS

  1. div.collapseBox
  2. {
  3. background-color: #eee;
  4. border: solid #222 1px;
  5. border-radius: 20px;
  6. padding: 0 10px 0 20px;
  7. margin: 1px 1px 1px 1px;
  8. overflow: auto;
  9. }

  10. div.collapseBox h1
  11. {
  12. font-size: 20px;
  13. display:inline;
  14. }

  15. div.collapseBox p
  16. {
  17. margin: 0 0 0 0;
  18. padding: 0 0 0 0;
  19. }

  20. div.collapseBox button
  21. {
  22. float:right;
  23. height: 20px;
  24. }