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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T01:49:53+00:00 2026-05-23T01:49:53+00:00

I have a list of several ‘triggers’ ( <li>s ), each trigger shows a

  • 0

I have a list of several ‘triggers’ (<li>s), each trigger shows a specific div, and each div has a ‘close’ button.

Now, I want to improve the usability by adding a timer/delay to the opened/visible div so that after 3 or 5 seconds after the user has moved their mouse away from the trigger, the opened/visible div fades out.

The problem I’m having right now, is that whenever I add a function with .mouseleave(), the opened/visible div hides as soon as the mouse leaves the trigger area.

However, if you remove the function, then the div stays visible and you’re able to close it by clicking the close button.

Here’s a [FIDDLE/DEMO] 1 of my situation.

Any help would be greatly appreciated.

Thanks.

  • 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-23T01:49:54+00:00Added an answer on May 23, 2026 at 1:49 am

    @locrizak’s answer is right (+1). This is because .delay() defaults to the effects queue, but .hide() with no parameters hides the selected elements without any effect, so the effects queue isn’t involved at all.

    If you want to hide without any animation, just use setTimeout:

    $('.trigger').mouseleave(function() {
        setTimeout(function () {
            $('.copy .wrapper').hide();
        }, 3000);
    });
    

    http://jsfiddle.net/mattball/93F3k/


    Last edit, I promise

    //Show-Hide divs
    var current;
    $('.trigger').live('mouseenter', function() {    
        var id = current = $(this).data('code');
        $('#' + id).show().siblings().fadeOut();
    }).live('mouseleave', function() {
        var id = $(this).data('code');
        current = null;
        setTimeout(function ()
        {
            if (current !== id) $('#' + id).hide(1);
        }, 3000);
    });
    
    //Close button
    $('.copy .wrapper span').live('click', function() {
        $(this).closest('.wrapper').stop(true, true).fadeOut();
    });
    

    Demo: http://jsfiddle.net/mattball/b2ew5/

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

Sidebar

Related Questions

I have a list, each item of which has several things in it, including
I have several ReorderLists on a page. Each list has items added to it
I have a list of stories on a page and each has several jQuery
I currently have a list view which has several rows of data and I
I have a list of objects, IList<O> . O has several properties but only
I have the following problem: I have to list several items each with several
I have several list view controls, each with many columns that I'd like to
I have list of some data items. Each has a method GetStyle which returns
I have an unordered list which contains several items called 'oListItems' the UL has
I have a sharepoint list which has several fields. It seems that when a

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.