Recently I wrote an HTML5 game framework. Today I wrote about a multi-layer click event monitoring. I think it's quite fun. So it was extracted from the module. The following code is just some ideas. The specific implementation is certainly not that ugly