I am currently using this script for the tab type. When one tab is pressed, it hides all the others. These are all divas. But right now, I donβt think it will quickly disappear before the selected Div boots up. It ends up being shifted under the selected div and is now displayed.
I do not need to switch, because, as you see, I have 5 tabs that I want to open when they are clicked. Fade out, fade away.
Any way to make fade out a case before fading out or maybe add a delay? I do not know how to add a delay to this script, or check that the div completely disappears before the new div disappears.
I would appreciate any help. Thanks!
<script> $("#teach_one").click(function() { $("#teach_one_s").fadeIn("slow"); $("#teach_two_s").fadeOut("fast"); $("#teach_three_s").fadeOut("fast"); $("#teach_four_s").fadeOut("fast"); $("#teach_five_s").fadeOut("fast"); }); $("#teach_two").click(function () { $("#teach_two_s").fadeIn("slow"); $("#teach_one_s").fadeOut("fast"); $("#teach_three_s").fadeOut("fast"); $("#teach_four_s").fadeOut("fast"); $("#teach_five_s").fadeOut("fast"); }); $("#teach_three").click(function () { $("#teach_three_s").fadeIn("slow"); $("#teach_one_s").fadeOut("fast"); $("#teach_two_s").fadeOut("fast"); $("#teach_four_s").fadeOut("fast"); $("#teach_five_s").fadeOut("fast"); }); $("#teach_four").click(function () { $("#teach_four_s").fadeIn("slow"); $("#teach_one_s").fadeOut("fast"); $("#teach_two_s").fadeOut("fast"); $("#teach_three_s").fadeOut("fast"); $("#teach_five_s").fadeOut("fast"); }); $("#teach_five").click(function () { $("#teach_five_s").fadeIn("slow"); $("#teach_one_s").fadeOut("fast"); $("#teach_two_s").fadeOut("fast"); $("#teach_three_s").fadeOut("fast"); $("#teach_four_s").fadeOut("fast"); }); </script>
Here is my HTML for your request:
<ul class="noselect teach_home_navigator_tabs"> <li id="teach_one"> </li> <li id="teach_two"> </li> <li id="teach_three"> </li> <li id="teach_four"> </li> <li id="teach_five"> </li> </ul> <div class="infotab teach_round" id="teach_one_s"> stufff </div> <div class="infotab teach_round" id="teach_two_s"> stufff </div> <div class="infotab teach_round" id="teach_three_s"> stufff </div> <div class="infotab teach_round" id="teach_four_s"> stufff </div> <div class="infotab teach_round" id="teach_five_s"> stufff </div>
source share