Good day. Tell me, please, how can I close the tab when I press it again? And one more thing: how to hide the '.bobs' block when opening any tab? Thanks a lot for your help!
$(".social_icons>a").click(function() { $(".social_icons>a").removeClass("current"); $(this).addClass("current"); $(".social_container>div").hide(); t_content=$(this).attr("href"); $(t_content).show('500'); return false }); .social_container { width:300px; height:50px; background: chocolate; } .social_container > div { display: none } .social_icons > a.current { background: aqua; } .bobs { width:100px; height:100px; background: red; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="social_icons"> <a href="#content1">Вкладка 1</a> <a href="#content2">Вкладка 2</a> <a href="#content3">Вкладка 3</a> <div class="social_container"> <div id="content1">Содержимое 1</div> <div id="content2">Содержимое 2</div> <div id="content3">Содержимое 3</div> </div> </div> <div class="bobs"></div>