Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8548399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:29:12+00:00 2026-06-11T13:29:12+00:00

The problem: In the example provided below, I have a sidenav with options, you

  • 0

The problem:

In the example provided below, I have a sidenav with options, you click to reveal a toggled div. If you click the third item in the menu “Dolar”, you will see you get a dropdown with three options appear below the link.

This is great, but I want the dropdown to close when I click on the other links. I’m not sure how to achieve this.

jsFiddle:

http://jsfiddle.net/visualdecree/4A23Z/39/

jQuery:

Note: I know it might be messy, I’m still learning this.

$('.sn a, .sn-alt a').on('click',function(){ // Sidenav panel script

    var panID = $("#" + $(this).data('panel') );

    $("div[id*='sn-pan-']")
    .stop()
    .hide({width:'toggle'},400);

    $(panID)
    .css({'left' : '139px','overflow':'visible'})
    .stop()
    .animate
    ({ width: "toggle", opacity: "toggle"
    }, { duration: "slow" });

    $(".control-view").hide();  // Fadein menu close button
    $(".control-view").not(":visible").stop().delay(400).fadeTo("fast", 0.33);   

});

$('.sn, .sn-drop').click(function(e) {
    $('ul.sidenav li').not(this).removeClass('active'); // Active class removal / add
    $(this).stop(true, true).toggleClass("active");    
});

$('.sn-alt').click(function(e) {
    $('ul.additional li').not(this).removeClass('active'); // Active class removal / add
    $(this).stop(true, true).toggleClass("active");    
});


$(".control-view").hover( // Hover effect for menu close button
    function () {
    $(".control-view").stop().hide().fadeTo("fast", 1); // Hover in
   }, 
    function () {
    $(".control-view").fadeTo("normal",0.33); // Fade back to previous set opacity
});

$('.control-view').click(function(e) {
        $("div[id*='sn-pan-']")
        .stop(true,true)
        .hide({width:'toggle'}, 100);

        $('ul.sidenav li').not(this).removeClass('active');

        $(".control-view").stop().fadeOut("fast");
});



$(".additional").hide(); // Controls for the 'design' dropdown

$(".sn-drop").click(function(){
    $(".additional").slideToggle(300);
    var scrt_var = Math.random();
    return false; //Prevent the browser jump to the link anchor
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T13:29:13+00:00Added an answer on June 11, 2026 at 1:29 pm

    Just add this JQuery, when you click on other link in your sidebar, it will close your .additional

    $(".sn").click(function(){
        $(".additional").slideUp(300);
        var scrt_var = Math.random();
        return false; //Prevent the browser jump to the link anchor
    });
    ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got a memory leak problem in the example below(u can download the
An application specific example to illustrate my immediate problem: I have a metadata provider
I am writing some documentation and I have a little vocabulary problem: http://www.example.com/en/public/img/logo.gif is
Example of the problem If I have a list of valid option strings which
i will give an example of the problem i have. My XML is like
Here's an example of my problem on jsFiddle. I have a table with striped
Example here: http://jsfiddle.net/KyW6c/2/ I have an ordered list. Each list item is a project
Ok, let's give you an example (original question below). I have made a package
I have an xml file which looks like the below example <Ids> <Id> <set>ai</set>
Solution to original problem (below) may have been discovered. I commented out <identity> ...

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.