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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:03:19+00:00 2026-06-08T07:03:19+00:00

This may seem like a simple and straightforward question and it probably has a

  • 0

This may seem like a simple and straightforward question and it probably has a straightforward answer. I have two drop down boxes in my toolbar, one that drops on hover and the other on click and the other on hover.

I can’t for the life of me figure out how to make them run independently. I am very new to jquery and have scoured the internet before coming here.

Fiddle without css but still does same thing.

http://jsfiddle.net/GQtuH/

Here is the jquery

$(document).ready(function () { 

$('#discoverDrop').hover(
    function () {
        //show its submenu
        $('ul, this').slideDown(500);

    }, 
    function () {
        //hide its submenu
        $('ul, thid').slideUp(500);         

});



$('#profile').toggle(function(){
        $('ul, this').slideDown(500);
    }, function(){
        $('ul, this').slideUp(500);
    });


});

And the neccesary markup

<span id="discoverDrop">
       <span id="drop"><m2>Discover</m2>
        <ul>
         <li><m2><a href="../artists"><m2>Artists</m2></a></li></m2>
         <li><m2><a href="../tracks"><m2>Tracks</m2></a></li></m2>
         <li><m2><a href="../sessions"><m2>Sessions</m2></a></li></m2>
         <li><m2><a href="../gigs"><m2>Gigs</m2></a></li></m2>
        </ul>         
       </span>
      </span>

      <span id="profile">
        <span id="profileDrop">
          <ul>
           <li><m2><a href="../phpscripts/logout.php"><m2>Logout</m2></a></li></m2>
           <li><m2><a href="../tracks"><m2>Tracks</m2></a></li></m2>
           <li><m2><a href="../sessions"><m2>Sessions</m2></a></li></m2>
           <li><m2><a href="../gigs"><m2>Gigs</m2></a></li></m2>
        </ul>         
        </span>
      </span>
  • 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-08T07:03:22+00:00Added an answer on June 8, 2026 at 7:03 am

    $(arg1, arg2) arg1 is usually a string containing selectors we need to get selected. arg2 is a jQuery Object inside which we should check for it.

    Doing $('ul, this') will pass a single argument 'ul, this' and jQuery will search for elements with tagname 'ul' and 'this' throughout the document.

    Doing $('ul', this) looks like what you want.

    $(document).ready(function () {
        $('#discoverDrop').hover(
            function () {
                //show its submenu
                $('ul', this).slideDown(500);
    
            },
            function () {
                //hide its submenu
                $('ul', this).slideUp(500);         
    
        });
        $('#profile').toggle(function(){
                $('ul', this).slideDown(500);
            }, function(){
                $('ul', this).slideUp(500);
            });
    
    });
    

    <span id="discoverDrop">
       <span id="drop"><m2>Discover</m2>
            <ul>
             <li><m2><a href="../artists"><m2>Artists</m2></a></li></m2>
             <li><m2><a href="../tracks"><m2>Tracks</m2></a></li></m2>
             <li><m2><a href="../sessions"><m2>Sessions</m2></a></li></m2>
             <li><m2><a href="../gigs"><m2>Gigs</m2></a></li></m2>
            </ul>         
       </span>
    </span>
    
    <span id="profile">
        Click Me to Toggle
        <span id="profileDrop">
            <ul>
               <li><m2><a href="../phpscripts/logout.php"><m2>Logout</m2></a></li></m2>
               <li><m2><a href="../tracks"><m2>Tracks</m2></a></li></m2>
               <li><m2><a href="../sessions"><m2>Sessions</m2></a></li></m2>
               <li><m2><a href="../gigs"><m2>Gigs</m2></a></li></m2>
            </ul>         
        </span>
    </span>
    

    Fiddle: http://jsfiddle.net/GQtuH/3/

    UPDATE

    If you are using float right for profile in the layout, its always recommended to put the right floated element first in the HTML. like :

    <span id="profile">
    ...
    </span>
    <span id="discoverDrop">
    ...
    </span>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may seem like a simple question, but I can't find the answer anywhere
This may seem like a very simple question, but I have been struggling with
This may seem like a simple question, but I can't find the definite answer:
This may seem like a stupid Question but i have two cubes being rendered
This may seem like a simple question but i am getting an error when
This may seem like a basic question. I have a light-weight website and would
this may seem like a very simple question, but I want to dump some
This may sound like a simple question, but I just cannot seem to find
This one may seem like a simple question, but it's really got me scratching
This may seem like a simple question however i've spent the last hour trying

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.