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

  • Home
  • SEARCH
  • 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 7193747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:13:57+00:00 2026-05-28T20:13:57+00:00

I have this code in html: <div id=menu> <div id=memberDetails><h3><span>Welcome,</span><br /> <em>John Doe</em></h3> </div>

  • 0

I have this code in html:

<div id="menu">
    <div id="memberDetails"><h3><span>Welcome,</span><br /> <em>John Doe</em></h3>        </div>
            <ul>
                    <li class="active"><a href="#home" class="contentLink">Home <span class="icon"></span></a></li>
                    <li><a href="#email" class="contentLink">Email<span class="icon"></span></a></li>
                    <li><a href="#sns" class="contentLink">Social Networking<span class="icon"></span></a></li>
                    <li><a href="#promos" class="contentLink">Promos<span class="icon"></span></a></li>
                    <li><a href="#rewards" class="contentLink">Rewards<span class="icon"></span></a></li>
            </ul>
</div>
  <div id="email-menu" style='display:none'>
        <div id="email-memberDetails"><h3><span>Welcome,</span><br /> <em>Another Menu</em></h3>        </div>
            <ul>
                    <li><a href="#all" class="contentLink">All <span class="icon"></span></a></li>
                    <li><a href="#yahoo" class="contentLink">Yahoo<span class="icon"></span></a></li>
                    <li><a href="#gmail" class="contentLink">Gmail<span class="icon"></span></a></li>
                    <li><a href="#hotmail" class="contentLink">Hotmail<span class="icon"></span></a></li>
            </ul>
</div>

My External Js code.

$(document).bind("mobileinit", function(){
$.mobile.pushStateEnabled = true;
});


    $(function(){
            var menuStatus;


            // Show menu
            $("a.showMenu").click(function(){
                    if(menuStatus != true){             
                    $(".ui-page-active").animate({
                            marginLeft: "160px",
                      }, 300, function(){menuStatus = true});
                      return false;
                      } else {
                            $(".ui-page-active").animate({
                            marginLeft: "0px",
                      }, 300, function(){menuStatus = false});
                            return false;
                      }
            });

            $('div[data-role="page"]').live('pagebeforeshow',function(event, ui){
                    menuStatus = false;
                    $(".pages").css("margin-left","0");
            });

            // Menu behaviour
            $("#menu li a").click(function(){
                    var p = $(this).parent();
                    if($(p).hasClass('active')){
                            $("#menu li").removeClass('active');
                    } else {
                            $("#menu li").removeClass('active');
                            $(p).addClass('active');

                    }
            });

            // Tabs 
            $('div[data-role="navbar"] a').live('click', function () {
                    $(this).addClass('ui-btn-active');
                    $('div.content_div').hide();
                    $('div#' + $(this).attr('data-href')).show();
            });

});

In my above code, I have two div which contain two different ul li contents. Now what I want to do is when in the link <li><a href='#email'> is click/active it will hide the <div id='menu'></div> and now show the <div id='email-menu'></div>. How can I do this in jquery? How can I determine if the email link is active?

  • 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-28T20:13:58+00:00Added an answer on May 28, 2026 at 8:13 pm

    Use the following code: http://jsfiddle.net/7W8a6/

    $("a").click(function() {
      var thiz = $(this);
      // hide all menu that ends with 'menu'
      $("div[id$=menu]").hide();
      // show [clicked id]-menu element
      $(thiz.attr("href") + "-menu").show();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this html code: <div id=menu> <ul id=menuFuncionalidades> <li> <div class=menuFuncionalidades_categoria> <a href=/sttenterprise/>Index</a></div>
I have this HTML code which simulates a dropdown multi-checkbox <div> <div class=select> <span>Select
I have this HTML code: <div class='com_box'> <div class='com_box_c'> <div class='com_box_info'> <a id='quote'>quote</a> </div>
I have this html code: <div class=action> some_text <a class=delete_action name=q1>some</a> </div> <div class=action>
i have this code $(function() { $('#ans_vote a span').click(function(){alert('working');return false;});}); and this html <div
Suppose I have the following html: This a test of <code>some code</code>. <div class='highlight'>
i have simple side menu with this html code : <div id=menu> <div> Menu
I have this HTML code : <ul class=navigation-links> <li class=link-item> <img src=images/new-menu/menu-item_04.png width=150 height=41
I have this HTML code: <div id=main> <div id=dv_7>...</div> <div id=dv_1>...</div> <div id=dv_8>...</div> <div
I have this code which can display drop down in div tag of html.

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.