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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:01:44+00:00 2026-06-02T07:01:44+00:00

with the follow code: $(‘someelement’).hover( function() { console.log(‘mouseenter begin’); setTimeout(function() { console.log(‘mouseenter ends’); },

  • 0

with the follow code:

$('someelement').hover(
    function() {
        console.log('mouseenter begin');
        setTimeout(function() {
            console.log('mouseenter ends');
        }, 2000);
    },
    function() {
        console.log('mouseleave begin');
        setTimeout(function() {
            console.log('mouseleave ends');
        }, 2000);
    }
)

If I enter and leave div at some times (or one time less then 2 seconds) my console get:

mouseenter begin
mouseleave begin
mouseenter ends
mouseleave ends

I want mouseleave only executed when mouseenter ends, but don’t know how.

mouseenter begin
mouseenter ends
mouseleave begin
mouseleave ends
  • 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-02T07:01:51+00:00Added an answer on June 2, 2026 at 7:01 am

    You could create a queue…

    http://jsfiddle.net/FHPGS/

    var queue = []
    
    $('someelement').hover(
        function() {
            queue.push('mouseenter begin');
            setTimeout(function() {
                var item = queue.shift();
                if (item)
                    console.log(item)
                console.log('mouseenter ends');
            }, 2000);
        },
        function() {
            queue.push('mouseleave begin');
            setTimeout(function() {
                var item = queue.shift();
                if (item)
                    console.log(item)
                console.log('mouseleave ends');
            }, 2000);
        }
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has me stumped. The follow code returns ,,,,,,: <script type=text/javascript> $(function() { $('#listB').sortable({
hey guys I have the follow code in js: $(document).ready(function(){ $(.replyLink).click(function(){ $(#form-to-+this.id).html(htmlForm()).toggle(500); return false;
I have asked and done the follow code: $(document).ready(function() { $('.gallery').each(function(index, element) { var
I have the follow code: window.onbeforeunload = function() { $.post( 'script/ratings.php', { data: dataToServer,
i have the follow code: searchResults.SearchResultCollection.Add( new SearchResult() { Header = HttpUtility.HtmlDecode( htmlDocument.DocumentNode .SelectSingleNode(initialXPath
Consider the follow code: TMyList = class(TList<IMyItem>, IMyList) Delphi shows me the error: [DCC
Hi i am having the follow code <div id=container> <div class=element NOTME></div> <div class=element></div>
I had created a zip file (together with directory) under Windows as follow (Code
So... is strange, I have the follow code in my Window control for setting
I'm trying to follow some example code from microsofts mdn site.. var WshShell =

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.