Created
February 6, 2013 20:24
-
-
Save YenTheFirst/4725480 to your computer and use it in GitHub Desktop.
Revisions
-
YenTheFirst created this gist
Feb 6, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ <html> <head> <style type="text/css"> #over{ position: absolute; left: 20; } </style> <script type="text/javascript"> window.onload = function() { console.log('loaded'); document.getElementById('base').onclick = function(e) { console.log('base got clicked'); } document.getElementById('over').onclick = function(e) { this.hidden = true; new_target = document.elementFromPoint(e.x,e.y); this.hidden = false; new_e = document.createEvent("MouseEvents"); new_e.initMouseEvent(e.type,e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget); new_target.dispatchEvent(new_e); e.preventDefault(); } } </script> </head> <body> <img src='http://placekitten.com/512/256' id='base'> <img src='http://placekitten.com/256/256' id='over'> blah </body> </html>