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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:30:01+00:00 2026-05-12T15:30:01+00:00

I’ve been trying to make a drop-down like NBC.com with no success–because I’m constrained

  • 0

I’ve been trying to make a drop-down like NBC.com with no success–because I’m constrained to using the following HTML.
I’d like it to be on mouseover–kind of like the UI accordion…
Any help would be greatly appreciated! 🙂

<div class="mainMenu" align="center">
    <table cellpadding="0" cellspacing="0" border="0" width="950">
        <tr>
            <td nowrap><div class="mainMenuDiv menuItem"><a href="http://dev.all4jesus.com/new/#new" class="mainMenuLink" id="1">I'm New</a></td>
            <td nowrap><div class="mainMenuDiv menuItem"><a href="http://dev.all4jesus.com/ministries/#ministries" class="mainMenuLink">Ministries</a></div></td>
            <td nowrap><div class="mainMenuDiv menuItem"><a href="http://dev.all4jesus.com/beliefs/#beliefs" class="mainMenuLink">Beliefs+Mission</a></div></td>
            <td nowrap><div class="mainMenuDiv menuItem"><a href="http://dev.all4jesus.com/listen/#listen" class="mainMenuLink">Listen</a></div></td>
            <td nowrap><div class="mainMenuDiv menuItem"><a href="http://dev.all4jesus.com/connect/#contact" class="mainMenuLink">Connect</a></div></td>
            <td width="100%"></td>
        </tr>
    </table>
</div>
    <div class="subMenu">
        <div id="new">
            <h2>I'm New</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
        </div>
</div>
  • 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-12T15:30:02+00:00Added an answer on May 12, 2026 at 3:30 pm

    This isn’t perfect, but should give you an idea:

    jQuery("div.subMenu div").hide();
    jQuery("div.mainMenu div.menuItem").mouseleave(function () {
          jQuery("div.subMenu div").hide();
       }).mouseenter(function () {
          var linkText = jQuery("a", this).text();
          jQuery("div.subMenu div").each(function (n) {
             var hdrText = jQuery("h2", this).text();
             if (linkText == hdrText) {
                jQuery(this).show();
             } else {
                jQuery(this).hide();
             }
          });
       });
    // update: keep the submenu open
    jQuery("div.subMenu div").mouseleave(function () {
       jQuery(this).hide();
    }).mouseenter(function () {
       jQuery(this).show();
    });
    

    I am presuming that there is a div under the subMenu for each menu item, eg.

    <div class="subMenu">
        <div id="new">
            <h2>I'm New</h2>
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit</p>
        </div>
        <div>
            <h2>Ministries</h2>
            <p>sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
        </div>
        <div>
            <h2>Beleifs+Mission</h2>
            <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco</p>
        </div>
        <div>
            <h2>Listen</h2>
            <p>laboris nisi ut aliquip ex ea commodo consequat.</p>
        </div>
        <div>
            <h2>Connect</h2>
            <p>Duis aute irure dolor in reprehenderit in voluptate velit</p>
        </div>
    </div>
    

    Explanation:

    1. Start off by hiding all the div‘s inside subMenu.
    2. The mouseleave on all the menu items unconditionally hides all the div‘s inside subMenu, even if they are already hidden.
    3. The mouseenter on all the menu items hides all those same div‘s, except it shows the one that has identical text inside the menu item’s link and the submenu’s h2 header. (There are definitely better ways to do this, but you need some way to correlate the menu item and the submenu. If you have any say about the id‘s, you might be able to use a naming convention that expresses the connections.)

    Update: Note that there’s a lot of unconditional hide() going on. For instance, the submenu will go away when the mouse leaves the menu item. To keep the submenu visible while the mouse is on it, add mouseleave and mouseenter handlers for "div.subMenu div" as well. To avoid flicker, you might need to keep track of the state of each submenu.

    Update 2: I’ve added a couple of lines to keep the submenu open while the mouse is in it. YMMV on flicker. This works for me without any change to the tables (it just ignores them). However, the submenu div‘s need to be positioned right against the menu item, so that the mouse can travel from the menu item to the submenu without it disappearing. In my test code, I set the following to make sure it would work:

    div.mainMenu div.menuItem,
    div.subMenu div,
    div.subMenu div h2 {
       margin-top: 0;
       margin-bottom: 0;
    }
    

    If this bunches up the text too much, you can add padding in lieu of margin.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to render a haml file in a javascript response like so:
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

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.