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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:16:03+00:00 2026-06-07T21:16:03+00:00

I have created a menu. It’s pretty basic but I got a problem which

  • 0

I have created a menu. It’s pretty basic but I got a problem which i haven’t figured out so far.

When page loads. All links are hidden in menu tab. When user clicks the tab links show up . But when user clicks any link tab collapsed again. So every time user has to click the tab to click any link.

I want the links to be shown untill the user clicks the tab.

Please check my code below. Please help, it’s been two days now i am dealing with this.

<a id="doc_test" >
    <img src="../../images/menu_icons/documents_button.png" border="0"  />
</a>
<br />
<div id="docSubLink_test" style="padding-left:10px;display: none;">
    <a class=""  id="d1" href="#" >apple</a><br />
    <a class=""   id="d2" href="#" >grapes</a><br />
    <a class=""   id="d3" href="#" >orange</a><br />
    <a class=""   id="d4" href="#" >peach</a><br />
</div>

Javascript:

if($('#docSubLink_test').is(':visible')) {
   $('#doc_test').click(function(){
       alert('1');
       //$('docSubLink_test').css("display","inline");  
       $('#docSubLink_test').slideUp(500);
       //$('docSubLink_test').slideUp('medium'); 
   });
}

if($('#docSubLink_test').is(':hidden')) {
   $('#doc_test').click(function(){
       //alert('1');
       //$('docSubLink_test').css("display","inline");  
       $('#docSubLink_test').show(500);
       //$('docSubLink_test').slideUp('medium'); 
   });
}

//Link to other page
$('#d1').click(function(){  
    $.get('http://www.abc.com/products/doc_test.php?orange',function(data){         
        $('body').html(data); 
    }); 
});
$('#d2').click(function(){          
    $.get('http://www.abc.com/products/doc_test.php?apple',function(data){
        $('body').html(data); 
    }); 
});
$('#d3').click(function(){  
    $.get('http://www.abc.com/products/doc_test.php?peach',function(data){
        $('body').html(data); 
    });
});
$('#d4').click(function(){  
    $.get('http://www.abc.com/products/doc_test.php?grapes',function(data){
        $('body').html(data); 
    }); 
});
  • 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-07T21:16:05+00:00Added an answer on June 7, 2026 at 9:16 pm

    I have already fixed that one. As I was refreshing the body with ajax result. so everytime i was clicking any link it refreshes the whole body containing menu itself. so menu collapses.
    Right answer was given by Gaby aka G. Petrioli in comments

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

Sidebar

Related Questions

I have created an HTML page which uses simple CSS (no javascript) for menu
I have created drop down menu, but it is not showing in home page
I have created a very basic custom layout to set out a menu made
I have created a dropdown menu with jquery: here Everything is ok but in
I have created a drop down menu using JQuery but when I test it
I have created user control for menu bar and loading in Master page. User
Have created a ATL COM project through which I am inserting Menu Items to
I have created a user page with a menu that contains a logout button.
I have created a CSS fly out menu . Seems to fly out the
I have a CSS vertical menu I have created code is below. (Test page

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.