Still hassling with IE6 and show/hide/fadeInOut
Yeah I know, this is getting boring - but it also drives me insane! :-)
I have this little test here - far from perfect, I know - but the basic functions are there:
- six #test_trigger_x DIVs that work as Trigger for six #test DIVs below with their own class
- each trigger fadeOut() all #test DIVs and then fadeIn() #test.objectx
Works fine in FF and Safari, in IE6 it's just strange:
- first trigger works half and shows #test.object1 but wont hide anything else
- second trigger works also half: it hides #test.object1 successfully but does nothing else
I'm not that good with special IE bugs or JS either (learning....) but this cannot be right ;-)
And workarounds that i missed? Couldn't find anything specific...
Thanks in advance!
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>TEST</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
- <script>
- $(document).ready(function(){
- $("#test_trigger_1").click(function(){
- $("div#test").fadeOut(100);
- $("div#test.object1").fadeIn(500);
- });
-
- $("#test_trigger_2").click(function(){
- $("div#test").fadeOut(100);
- $("div#test.object2").fadeIn(500);
- });
-
- $("#test_trigger_3").click(function(){
- $("div#test").fadeOut(100);
- $("div#test.object3").fadeIn(500);
- });
- $("#test_trigger_4").click(function(){
- $("div#test").fadeOut(100);
- $("div#test.object4").fadeIn(500);
- });
-
- $("#test_trigger_5").click(function(){
- $("div#test").fadeOut(100);
- $("div#test.object5").fadeIn(500);
- });
-
- $("#test_trigger_6").click(function(){
- $("div#test").fadeOut(100);
- $("div#test.object6").fadeIn(500);
- });
- });
- </script>
- <style type="text/css">
- <!--
- -->
- </style>
- </head>
- <body>
- <div id="test_trigger_1" style="background-color:#CCC; width:120px; height:20px">A</div>
- <div id="test_trigger_2" style="background-color:#FFE; width:120px; height:20px">B</div>
- <div id="test_trigger_3" style="background-color:#EEE; width:120px; height:20px">C</div>
- <div id="test_trigger_4" style="background-color:#FCF; width:120px; height:20px">D</div>
- <div id="test_trigger_5" style="background-color:#DEF; width:120px; height:20px">E</div>
- <div id="test_trigger_6" style="background-color:#ef1; width:120px; height:20px">F</div>
- <div id="test" class="object1" style="background-color:#CCC; width:120px; height:120px">TEST A</div>
- <div id="test" class="object2" style="background-color:#FFE; width:120px; height:120px">TEST B</div>
- <div id="test" class="object3" style="background-color:#EEE; width:120px; height:120px">TEST C</div>
- <div id="test" class="object4" style="background-color:#FCF; width:120px; height:120px">TEST D</div>
- <div id="test" class="object5" style="background-color:#DEF; width:120px; height:120px">TEST E</div>
- <div id="test" class="object6" style="background-color:#ef1; width:120px; height:120px">TEST F</div>
- </body>
- </html>