Questions tagged [mouseleave]

For issues relating to setting up, subscribing to, or handling mouseleave events.

Mouseleave is an event that fires when the user moves the mouse out of the element you registered the event on.

525 questions
114
votes
5 answers

What is the difference between jQuery's mouseout() and mouseleave()?

What is the difference between jQuery's mouseout() and mouseleave()?
Dave
  • 8,879
  • 10
  • 33
  • 46
32
votes
2 answers

Check what element the cursor is on upon mouseleave() with jQuery?

I have a set of list elements (
  • within a
      ) laid out as bubbles on a chart like this, where the bubbles are the
    • elements: https://i.stack.imgur.com/PR7vR.png I want to be able to detect the difference between Moving the mouse from…
  • Tyler Nieman
    • 375
    • 1
    • 4
    • 9
    16
    votes
    5 answers

    Mouseover and mouseleave trigger every time I move the mouse inside the given element

    I am creating a site where you hover the mouse over an image and it shows an element (in this case by expanding its height from 0 to 154px). jQuery(document).ready(function(){ jQuery("#dropdown-menu-create .dropimage").mouseover(function(){ …
    bcloutier
    • 411
    • 2
    • 4
    • 11
    15
    votes
    2 answers

    In React, onMouseEnter or hover is not working as expected

    I have one image with opacity = 1 at the beginning. When mouse enters the image, change opacity = 0.5. When mouse leaves the image, change the opacity back. here is one code: mouseEnter() { console.log('mouse enter') const classname = '.' +…
    Benjamin Li
    • 1,687
    • 7
    • 19
    • 30
    13
    votes
    3 answers

    How can I trigger a mouseout event for two elements in jQuery?

    Let's suppose I have two spearate divs, A and B, which overlap at a corner: +-----+ | | | A | | +-----+ +---| | | B | | | +-----+ I want to trigger an event when the mouse leaves both A and B. I tried this $("#a,…
    Peter Olson
    • 139,199
    • 49
    • 202
    • 242
    11
    votes
    6 answers

    Jquery mouseleave effect through div's bottom border

    This is making me crazy. Is there a way to fire a mouseleave jquery effect only if leaving the div through its bottom border? That is, preventing said effect from taking place if the mouse pointer leaves the div through any of the other 3 borders. I…
    Carlos Pardilla
    • 215
    • 3
    • 9
    10
    votes
    4 answers

    MouseHover/MouseLeave event on the whole entire window

    I have Form subclass with handlers for MouseHover and MouseLeave. When the pointer is on the background of the window, the events work fine, but when the pointer moves onto a control inside the window, it causes a MouseLeave event. Is there anyway…
    billpg
    • 3,195
    • 3
    • 30
    • 57
    9
    votes
    3 answers

    .mouseleave() with .delay() working together

    I have a list of several 'triggers' (
  • s), each trigger shows a specific DIV, and each DIV has 'close' button. Now, I want to improve the usability by adding a timer/delay to the opened/visible DIV so that after3 or 5 seconds after the user has…
  • Ricardo Zea
    • 10,053
    • 13
    • 76
    • 79
    9
    votes
    2 answers

    Select triggers MouseLeave event on parent element in Mozilla Firefox

    I have the following problem: In Mozilla Firefox, whenever I hover a dropdown inside a table, it triggers the mouseleave event of the table, though the mouse cursor is still inside the table. There is no such problem in Chrome or Edge. Here is my…
    nyagolova
    • 1,731
    • 2
    • 26
    • 42
    9
    votes
    1 answer

    mouseleave event does not fire on mouse wheel scroll in IE11

    When using the mouse wheel to scroll down a page, the mouseleave event is not firing in IE11 until the cursor is moved. Works fine in Google Chrome. jsFiddle: http://jsfiddle.net/tonyleeper/5vwf65f7/ HTML
    Move the mouse cursor…
    magritte
    • 7,396
    • 10
    • 59
    • 79
    9
    votes
    7 answers

    Removing Class with Mouse Exit

    I am performing a on mouseenter / mouseleave with jQuery and it appears to be working but not when I exit the div. This is only working when I exit the actual window. This is my jQuery $(document).ready(function() { $(".pods…
    Kirsty Marks
    • 95
    • 1
    • 8
    8
    votes
    1 answer

    jQuery mouseleave not firing correctly while dragging

    I have a sortable list with a mouseleave event listener that is behaving incorrectly. If I move the mouse in and out of the sortable list, mouseleave fires correctly. If I first click and drag one of the sortable's children, mouseleave fires…
    John
    • 1,324
    • 3
    • 14
    • 19
    8
    votes
    3 answers

    mouseleave not firing after mouseenter changes HTML within anchor

    I'm sure I'm overlooking something but I can't seem to get the "mouseleave" event to fire after I replace the html within the anchor tag that triggered the mouseenter. Adding code here but really it's much simpler if you visit the JSFiddle link…
    Adergaard
    • 760
    • 10
    • 24
    8
    votes
    2 answers

    mouseenter/mouseleave ignoring covering element

    It seems that the mouseenter/ mouseleave method is trigger not only when the mouse's coordinate enters the target's client rectangles, but also when another element uncover or cover the target. This is a problem because in my mouseenter callback, I…
    user690421
    • 422
    • 1
    • 5
    • 15
    8
    votes
    1 answer

    JQuery hover loop

    I have a problem with this JQuery code: $(".item").mouseenter(function(){ $(this).addClass("active"); $(this).removeClass("item"); $(".item").hide(700); }).mouseleave(function(){ $(this).stop(); $(this).addClass("item"); …
    Mohsen Safari
    • 6,669
    • 5
    • 42
    • 58
    1
    2 3
    34 35