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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:55:18+00:00 2026-05-30T10:55:18+00:00

I have a problem with this code, the mouseleave function is firing on IE

  • 0

I have a problem with this code, the mouseleave function is firing on IE without the mouse entering first in the div.

<script type="text/javascript">
$(document).ready(function() {
    $('#<?php echo 'div_'.$reload_cont; ?>').mouseenter(function() {

        var el = $(this);
        var timeoutId = setTimeout(function() {
            $('#<?php echo 'relo_'.$reload_cont; ?>').animate({opacity: 1}, 'slow');
        }, 500);

        el.mouseleave(function() {
            clearTimeout(timeoutId);
            $('#<?php echo 'relo_'.$reload_cont; ?>').animate({opacity: 0}, 'slow');
        });
    });
});

</script>

I’ve tryied a lot of ways and none seems to work.

Any help here

  • 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-30T10:55:20+00:00Added an answer on May 30, 2026 at 10:55 am

    You are re-binding the mouseleave event every-time the mouseenter event fires, try moving the mouseleave event handler outside the mouseenter event handler:

    $(function() {
    
        //notice the timeout variable is saved in a scope where both event handlers can access it
        var timeoutId;
    
        $('#<?php echo 'div_'.$reload_cont; ?>').mouseenter(function() {
    
            timeoutId = setTimeout(function() {
                $('#<?php echo 'relo_'.$reload_cont; ?>').stop().animate({opacity: 1}, 'slow');
            }, 500);
        }).mouseleave(function() {
            clearTimeout(timeoutId);
            $('#<?php echo 'relo_'.$reload_cont; ?>').stop().animate({opacity: 0}, 'slow');
        });
    });
    

    Notice the use of .stop() so multiple animations don’t queue-up if you mouse-enter and then mouse-leave many times rapidly.

    Here is a demo: http://jsfiddle.net/jasper/LJAqd/

    I tested this in IE 8/7 and it worked as expected, but I can’t be sure it will work for your implementation because I don’t know the HTML structure of your code.

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

Sidebar

Related Questions

I have the following Javascript/jQuery function: function addEventHandler(){ $(div).mouseenter(function() { $(this).html(Over); }).mouseleave(function() { $(this).html(Out);
I have weird problem with this code $('img').hover(function(){ var $cap = $(this).parent().find('.cap'); window.setTimeout(function(){$cap.stop(true,false).animate({bottom:164},500)},500); },function(){
I got a problem, I have this code: $(document).ready(function(){ /* The following code is
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem with this code: file = tempfile.TemporaryFile(mode='wrb') file.write(base64.b64decode(data)) file.flush() os.fsync(file) # file.seek(0)
Hi i have problem with this code, i found it on the internet and
i am a beginner and i have a problem : this code doesnt compile
I'm a beginner with jdbc ... I have a problem running this code :
I have a problem with this is code: Set oXmlHTTP = CreateObject(Microsoft.XMLHTTP) oXmlHTTP.Open POST,
I have this code, but I have a problem. When I update but do

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.