I am facing a unique challenge with my website design - I have implemented a semi-transparent header and footer, and now I need to capture click and hover events in order to trigger the same event on a different DOM element at the exact mouse location.
While I have managed to successfully retrieve the mouse coordinates using the code snippet below, attempting to trigger the same event with $("#container").trigger(e);
has not yielded the desired result.
$("#header, #footer").click(function(e){ //only intercept click if it did not fall on an a tag if(!$(e.target).is("a")){ e.preventDefault(); $("#container").trigger(e); //does not work alert(e.pageX +', '+ e.pageY); //works return false; } });