Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting new div before leaving the other one
Message
De
21/03/2016 10:15:17
 
 
À
21/03/2016 05:58:18
Information générale
Forum:
Javascript
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01633406
Message ID:
01633421
Vues:
34
>You might try a workaround where the div1.mouseout() handler execution is delayed for a couple of milliseconds and div2.mouseover() sets a flag; div1.mouseout() can check for this flag to decide what to do; the issue is how you make sure this flag is reset.

Can't slow down the process as, the reason to do this, is exactly to make things faster.

>If you can make sure that no other elements sits between the 2 divs (eg. by overlapping), you can try to use event.relatedTarget in div2.mouseover():
>
>jQuery('#div2').mouseover(function(ev){
>  if (ev && ev.relatedTarget && ev.relatedTarget.id && ev.relatedTarget.id === 'div1') ev.relatedTarget.method();
>  ...
>});
>
Yes, that's the initial code I had. But, actually, this was on the onmouseout event. I will check this out again and let you know.
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform