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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:12:54+00:00 2026-05-26T06:12:54+00:00

I know the mouseenter is coded such that it propagates mouseover to all the

  • 0

I know the mouseenter is coded such that it propagates mouseover to all the elements within the DOM that it is bound to.

So, like the question states, is there a way to manually apply this propagation to other elements that are separate from the DOM, which I bound the mouseenter event to.

The function, $.stopPropagation(), stops the propagation but is there an applyPropagationTo like function?

Here is the scenario:

Say I have a div, class=divCON. I have a absolute positioned div appended to the body, called divHOV, which is hid. When I mouseenter divCON, divHOV becomes visible and follows my mouse when I am within divCON.

I want it so that when my mouse is moving within divCON, the mouse tends to enter divHOV if the browser is slow to reposition the divHOV while moving the mouse. I want it so that I can propagate divHOV’s mouseenter onto divCON so that a mouseleave event is not trigger when I go on divHOV.

jsFiddle: http://jsfiddle.net/vuxcR/

Note how when the mouse enters divHOV, it mouseleaves the divCON. I want it so that when it does not mouseleave divCON when I enter divHOV.

  • 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-26T06:12:54+00:00Added an answer on May 26, 2026 at 6:12 am

    Fiddle: http://jsfiddle.net/vuxcR/1/

    Here’s the desired code. See the comments and bottom for explanation:

    $(document).ready(function() {
        var $divCON = $(".divCON");
        $divCON.bind("mouseenter", function() {
    
            //Cancel if this function has already run (so, if the next element
            //  has class divHOV
            if($(this).next().hasClass('divHOV')) return;
            $divHOV = $("<div class='divHOV'></div>");
            $divHOV.mousemove(function(ev){
                var offset = $divCON.offset();
    
                var height = $divCON.height();
                var width = $divCON.width();
    
                var left = offset.left;
                var top = offset.top;
    
                var bottom = top + height;
                var right = left + width;
    
                // If the mouse coordinates are within the box
                if(ev.pageX >= left && ev.pageX <= right &&
                   ev.pageY >= top && ev.pageY <= bottom){
    
                    //Trigger move.
                    $divHOV.css({'top': ev.pageY - 3 + 'px', 'left': ev.pageX + 3 + 'px'});
                }
            });
            $(this).after($divHOV);
        });
        $divCON.bind("mousemove",function(e) {
            $(".divHOV").css({'top': e.pageY - 3 + 'px', 'left': e.pageX + 3 + 'px'});
        });
    });
    

    When the user enters .divCON for the first time, .divHOV is added. When moving the mouse (see bottom), divHOV is positioned again. Once the mouse enters .divHOV, the coordinates are calculated again IF the mouse is within the box of divCON.

    When the mouse enters .divCON again, the function immediately returns, because .divHOV already exists: if($(this).next().hasClass('divHOV')) return;.

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

Sidebar

Related Questions

I know that I can do something like $int = (int)99; //(int) has a
first some code: I have many elements like that: <section class=item> <div class=caption> </div>
Know of an OCAML/CAML IDE? Especially one that runs on Linux?
I know in certain circumstances, such as long running processes, it is important to
I dont know what is the problem with this ? $('.post').live('mouseenter mouseleave', function() {
I know this should be very simple especially given all the information and example
I have a popup in a custom control that popups with a mouseenter event.
I have several Border elements with stuff inside that are generated at runtime. I
I have a basic code like this (that duplicates several times): <h3 class=header>The header</h3>
I have a bunch of elements that trigger a tooltip on hover. The problem

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.