In javascript coding, there is an event delegation technique.
This is the way to delegate event that I only know :
Give an event(like click) to father elem, and get that event using 'target'.
For example :
document.addEventListener('click', function(event), true/false);
function(event){
get event codes;
get target codes;
switch (target.id) {
case 'outside_1': blah~~~; break;
case 'outside_2': blah~~~; break;
}}
In these codes, if target has some child node and clicked it, event will not run.
situation : click the <a>
;;
case 1: <a id="outside_1"> nav 1 </a> // this will work.
case 2: <a id="outside_2"> <img class="navImg"> <p> nav 2 </p> </a> // this will not work.
And if there is no way to make 'code:case 2' works, I think delegate event technique is not that good way of js coding...
How do you think about that, guys?