2

Please see the code below (very stripped back and not my full function). I've also got a fiddle that you can test it at: https://jsfiddle.net/glenn2223/uk7e7rwe/1/

var 
    hov = $("<div class=\"over\">I'm Over You</div>"),
    box = $("<div>Result: WAITING</div>")


$("body").append(hov).append(box);

$("#MeHover").on('mouseleave', function(){
    var d = new Date();
    box.text("Result: " + hov.is(":hover").toString().toUpperCase() );
});

We have a div and div.over overlaps it slightly. When you move from div to div.over I want the function to return true.

In my full function: this stops it from hiding the div.over element.

Opening it in Chrome it works as expected. However, it's not in pretty much everything else (Tested in: Edge, IE11 and Firefox).

8
  • I'm using jQuery 3.1.0, BTW
    – glenn223
    Commented Sep 20, 2017 at 10:50
  • The fiddle works the same for me in Chrome and IE11
    – Nope
    Commented Sep 20, 2017 at 10:56
  • @Fran. That's strange. Do mean both working or both not working? What version of IE are you running? I'm on Version: 11.608.15063.0 - Update Version: 11.0.46
    – glenn223
    Commented Sep 20, 2017 at 11:05
  • You mention in your post that the code behaves different in browsers other than Chrome. When Run your fiddle in Chrome or IE11.0.9600.18792 Update Version 11.0.46 it behaves in both browsers the exact same when hovering over the areas the time in the text is updated just the same. If that is right or not I have no idea but the behavior is identical.
    – Nope
    Commented Sep 20, 2017 at 11:24
  • So both say TRUE? The time update (in the fiddle) is just so you know that the action is being performed. If so, then it may be your version if you're on 11.0.9600. What do you think? Bloody IE!
    – glenn223
    Commented Sep 20, 2017 at 11:30

1 Answer 1

0

Okay so we've found out why it doesn't work the :hover was removed from .is() a while back.

Rather than changing this question to suit my findings I will ask another (saves confusion).


My New Question: Keep jQuery Appended Element Open When Hovering It

Not the answer you're looking for? Browse other questions tagged or ask your own question.