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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:44:32+00:00 2026-06-13T11:44:32+00:00

I have a small problem in my code, and im not sure how to

  • 0

I have a small problem in my code, and im not sure how to solve it.

Here is a Fiddle with detailed comments: http://jsfiddle.net/4aZbp/

Basically, I have a list of elements, when you hover each element there’s a “+” icons that shows.

When you click on that button, a little menu appears.

That menu is NOT inside the li, it’s a absolute hidden menu at the top of the page that Im positionning with jQuery. So, one menu for all the elements.

That menu should stay open until the user mouseleave the <li>. So far, so good,

My problem is that it needs to remain open when the user try to click INSIDE that menu. I can’t get that to work, cause the menu is outside the div and it needs to remain there.

Any solution? Please check the Fiddle

http://jsfiddle.net/4aZbp/

$(document).ready( function() {

    // Position the menu & show it at the right place when you click on the "+" button

    $(".open-playlist-link").click(function() {       
        var offset = $(this).offset();
        var offsetTop = Math.round(offset.top);
        var offsetLeft = Math.round(offset.left);

        var menu = $('.add-to-playlist-menu');

        menu.css( {
            top : offsetTop +20,
            left : offsetLeft }
        );
        menu.toggleClass('display-none');      
    });

    // Hide the "+" button when you leave the wrapper of the <li> 

    $(".wrap").mouseenter(function() {
            $(this).children('.add-to-playlist-icon').removeClass('display-none');
        }).mouseleave(function(){
            $(this).children('.add-to-playlist-icon').addClass('display-none');
    });

    // Hide the menu when you leave the wrapper, but you need to be able to click the link inside the menu. When you leave the menu, we hide it. ISSUE HERE.

    $('.wrap').mouseleave(function(){
        $('.add-to-playlist-menu').addClass('display-none');
    });
});​
  • 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-13T11:44:33+00:00Added an answer on June 13, 2026 at 11:44 am

    Suppose the easiest way to make it work like you want will be to move menu insed an li.

    Here is not completely finished demo, but it should be easy enough to add required behavior (like hidding menu after LI is left)

    Main update is here (new line $(this).parent().append(menu); and removed css positioning):

      $(".open-playlist-link").click(function() {       
            var offset = $(this).offset();
            var offsetTop = Math.round(offset.top);
            var offsetLeft = Math.round(offset.left);
    
            var menu = $('.add-to-playlist-menu');    
    
            menu.toggleClass('display-none');      
            $(this).parent().append(menu);
        });
    

    As menu div is not inside LI – that event happens any time you move your mouse to menu div. To avoid this you should have menu div inside LI (actually, div.wrap according to provided code).

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

Sidebar

Related Questions

Here a small piece of code for testing and explain the problem. I have
I have a small Problem using reg. expressions with scanner here's the code: String
Small problem here with an MVC app that I'm not sure how to figure
Im having a small problem with my code. I have been trying to read
I have a small problem which i can't seem to solve myself. Look at
I'm having a small problem with ASP.NET MVC and Entity Framework 4. I have
I am having a problem with the below code and I am not sure
have small problem, and would very much appreciate help :) I should convert byte
I have small problem with Spring MVC. Basically what I'm trying to do is
I have a small problem and I've figured out where when and why it

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.