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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:29:57+00:00 2026-05-22T16:29:57+00:00

I have been playing with the jDiv dropdown menu developed by Skyrocket Labs and

  • 0

I have been playing with the jDiv dropdown menu developed by Skyrocket Labs and improved by Peter Hinton. It works well for multiple menus on the same page, as long as you replicate the code with different identifiers (#nav1 triggers #hidden-menu1, #nav2 triggers #hidden-nav2, etc).

        var hide1 = false;
$("#nav1").hover(function(){          
    if (hide1) clearTimeout(hide1);
    $("#hidden-nav1").show();
    }, function() {
    hide1 = setTimeout(function() {$("#hidden-nav1").hide();});
    });

    $("#hidden-nav1").hover(function(){
    if (hide1) clearTimeout(hide1);
    }, function() {
    hide1 = setTimeout(function() {$("#hidden-nav1").hide();});
    $("#hidden-nav1").stop().show();
    });

I am trying to sort out how to rewrite the code so that it can, “discover” the numerical value of the navX linked hovered and trigger the appropriate hidden-navX divs.

  • 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-22T16:29:58+00:00Added an answer on May 22, 2026 at 4:29 pm

    Here is a working
    JSFiddle DEMO

    I removed ALL ID’s just to show how easy and striped can be the code and functional too, just using classes.

    You can undo your ID’s if you need to use them, but leave all unchanged.

    If you need explanation about the code I can comment each line.

    Here is the new/changed Jquery:

    $(document).ready(function() {
    
        var countNavs = 0; $('#navlist li').attr('class', function() {countNavs++;return 'connected' + countNavs;});
        var countDrops = 0; $('.dropdown').attr('class', function() {countDrops++;return 'dropdown connected' + countDrops;});
    
        var hide1 = false;            
        $("#navlist li").hover(function(){    
            var equal = $(this).attr('class');
    
            $('.active').removeClass();
        if (hide1) clearTimeout(hide1);
            $('.dropdown').hide();
            $('.'+equal).not('li').show();
            $(this).children('a').toggleClass('active');                
        }, function() {
            hide1 = setTimeout(function() {$('.'+equal).not('li').hide();});
        });
    
        $('.dropdown').hover(function(){        
            if (hide1) clearTimeout(hide1);            
        }, function() {            
            hide1 = setTimeout(function() {$('.dropdown').hide();});
            $('.active').removeClass();        
            $('.dropdown').stop().show();
        });
    
    });
    

    With COMMENTS

    To help you understand in few words: We add automatically a SAME custom class to each ‘li’ and his corespondent ‘dropdown’ called: ‘.connectedN’,
    where ‘N’ is an incremented number.
    Than we just say: if the hovered ‘li’ is class ‘connected3’ that means we just hovered the 3th ‘li’ , and we’ll go to open the ‘.dropdown’ that have the SAME class.

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

Sidebar

Related Questions

I have been playing with Boost.Random for a day now, and while boost::uniform_int_distribution<> works
I have been playing with the Ruby library shoes. Basically you can write a
I have been playing with this for a while, but the closest I have
I have been playing with the Linq to Sql and I was wondering if
I have been playing around with the postgresql.conf file for a couple days now.
I have been playing with javascript arrays and I have run into, what I
I have been playing around with the EF to see what it can handle.
I have been playing with the demo code from this msdn article by Jeffrey
I have been playing around with the MS Source Server stuff in the MS
I have been playing around a bit with a fairly simple, home-made search engine,

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.