Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Recognizing click on a div
Message
De
14/03/2016 21:19:18
 
 
À
14/03/2016 20:56:08
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01633076
Message ID:
01633083
Vues:
39
Ok, so this takes care of it:

http://jsfiddle.net/DUhP6/181

Basically, I have to go up to chain until I find a specific div I can rely on.

The click on the outside container would then be as follow:
document.getElementById('outer-container').onclick = function(e) {
loTarget=e.target
while (loTarget.parentNode)
{
   loTarget=loTarget.parentNode
   if (loTarget.id=='DivIFrame')
   {
      return false
   }
}
alert('Clicked on outside window')
}
If someone knows a better or simpler way, feel free to share.
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform