Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting new div before leaving the other one
Message
From
21/03/2016 14:00:55
 
 
General information
Forum:
Javascript
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01633406
Message ID:
01633435
Views:
37
>Not sure that would work - if you have code in the mouseout of the div that has been left it will still fire before the mouseover of the entered div.....
>
>You could try (again assuming no intervening element):
    oDiv.onmouseout = function(e) {
>                     
>                      if (e.relatedTarget.id === 'other-div') {
>                          document.getElementById('other-div').onmouseover();
>                      }
>                      //other code here
>                  };
Maybe also set a flag in the mouseover event handler to prevent the system mouseover running the code again

Correct me if I am wrong, but my tests so far, have proven that as soon as we go out of the div, the relatedTarget.id is that div and not the one we are stepping into.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform