I've been busy trying to incorporate multiple expanding divs into a webpage, but I'm struggling to make the divs collapse automatically when another one expands. This is the script I've been experimenting 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'){
}
});
});
});