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 3844138
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:02:32+00:00 2026-05-19T16:02:32+00:00

I have two menus: the Accordion menu and Tab menu, for the Tab menu,

  • 0

I have two menus: the Accordion menu and Tab menu, for the Tab menu, there is an assigned class selected to a link that is opened, I want to assign the class (for example) open_menu, in the same way for the accordion menu. actually if the class open_menu will be given from the condiotion that in its ul there is an A link with class Selected, it would be much better, because the class selected given to a link is taken from the cookies, and even if the page is refreshed it comes to this link Selected. Anyway, u can see all the source here: http://jsfiddle.net/bq6tA/6/
actually the end product i want, after the refresh of the page, there will be opened the accordion’s tab, as well as the Tab’s menu link selected that is in this accordion’s tab

  • 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-05-19T16:02:33+00:00Added an answer on May 19, 2026 at 4:02 pm

    See a working demo of the following code here.

    I’ve modified your initMenu function to add the open_menu class to the appropriate accordion (and added a CSS class to indicate that it was added by changing the background to green):

    function initMenu() {
        // SNIP ...
        $('#menu li a').click(function() {
            // SNIP ...
            if ((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
                $('#menu ul:visible').slideUp('normal')
                                     .siblings('a').removeClass('open_menu');
                checkElement.slideDown('normal')
                            .siblings('a').addClass('open_menu');
                return false;
            }
        });
    }
    

    I then created a function to be called after initMenu that will trigger a click on the accordion with the same rel as the id of the currently selected item:

    function showCurrentTab() {
        var curId = $('.tabcontent:visible')[0].id,
            $curLink = $('a[rel="'+curId+'"]');
    
        $curLink.closest('ul')
                .parent('li')
                .children('a').click();
    }
    

    To figure out what’s going on here, see the API docs for closest, parent and children and relate that to your HTML structure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At my view I have two menus that I want to make dependent, namely,
I want to have two different jQuery UI accordion menus on the same page,
I have an ascx component, that holds two-level menu, because there are several user
I have two dropdown hidden menus ie menu A and menu B that shows
I have a menu bar that is rotated slightly. Here are two buttons as
I have an app that so far consists of two Activities: The Main Menu
I have created a web application in which there are two menus which load
I have an auto-scrolling thumbnail DIV that I want to insert into an accordion
I would like to have two options menus in Android that are triggered using
Taxonomy Menu created two menus, which have not gone even after I disabled it.

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.