hide - Javascript toggle click off -


i working on adding several expanding divs page, running trouble getting divs automatically collapse when expands. here script working with:

$(document).ready(function() {     $('.nav-toggle').click(function(){         var collapse_content_selector = $(this).attr('href');                            var toggle_switch = $(this);         $(collapse_content_selector).toggle(function(){             if($(this).css('display')=='none'){             }         });     }); });  

try this:

$(document).ready(function() {     $('.nav-toggle').click(function() {         var selected = $($(this).attr('href'));         $(".tab").not(selected).hide();         selected.toggle();     }); }); 

replace .tab class use expandable divs.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -