Making sub-menus exclusive [closed]

I’m making some assumptions here, like you are the one writing the code for the theme, or at least have the ability to modify the JavaScript in some way.

You can accomplish this using jQuery using code along these lines:

$(document).ready(function () {
    $('.parent ul').slideUp();
    $('.parent > li > a').on('click', function (e) {
        e.preventDefault();
        var $this = $(this);
        $this.parent().siblings().find('ul').slideUp();
        $this.siblings('ul').slideDown();
    });
});