(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
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <link rel="stylesheet" type="text/css" href="/css/redmond/jquery-ui-1.8.2.custom.css" />
- <link rel="stylesheet" type="text/css" href="/test.css" />
- <script src="/jquery-1.4.2.js" type="text/javascript"></script>
- <script src="/js/jquery-ui-1.8.2.custom.min.js"></script>
- <body>
- <div class="collapseBox" id="employees">
- <h1>Hit Me</h1>
- <div style="clear: both;"></div>
- <p>
- Here is some text <br />
- Just to play <br />
- Lets see if it will work <br />
- </p>
- </div>
- <div class="collapseBox" id="people">
- <h1>Hit Me</h1>
- <div style="clear: both;"></div>
- <p>
- Here is some text <br />
- Just to play <br />
- Lets see if it will work <br />
- </p>
- <div class="collapseBox" id="people">
- <h1>Hit Me</h1>
- <div style="clear: both;"></div>
- <p>
- Here is some text <br />
- Just to play <br />
- Lets see if it will work <br />
- </p>
- </div>
- </div>
- <script>
- $(document).ready(function (){
- $('<button>+</button>').insertAfter('div.collapseBox h1');
- $('div.collapseBox div').nextAll().slideUp('fast');
- $('div.collapseBox button').click(function ()
- {
- var item = $(this);
- if (item.text() == "+")
- item.text('-');
- else
- item.text('+');
- item.next().nextAll().slideToggle('fast');
- });
- if ($.browser.msie && $.browser.version < 8)
- $('div.collapseBox h1').css({'float': 'left'});
- });
- </script>
- </body>
- </html>
CSS
- div.collapseBox
- {
- background-color: #eee;
- border: solid #222 1px;
- border-radius: 20px;
- padding: 0 10px 0 20px;
- margin: 1px 1px 1px 1px;
- overflow: auto;
- }
- div.collapseBox h1
- {
- font-size: 20px;
- display:inline;
- }
- div.collapseBox p
- {
- margin: 0 0 0 0;
- padding: 0 0 0 0;
- }
- div.collapseBox button
- {
- float:right;
- height: 20px;
- }