Skip to content

Instantly share code, notes, and snippets.

@johno
Last active December 20, 2015 12:59
Show Gist options
  • Save johno/6135663 to your computer and use it in GitHub Desktop.
Save johno/6135663 to your computer and use it in GitHub Desktop.
Duck IE
// From http://stackoverflow.com/questions/3680429/click-through-a-div-to-underlying-elements/4839672#4839672
$('.duck_ie').click(function(e) {
var left = $(window).scrollLeft();
var top = $(window).scrollTop();
//hide the overlay for now so the document can find the underlying elements
$(this).css('display','none');
//use the current scroll position to deduct from the click position
$(document.elementFromPoint(e.pageX-left, e.pageY-top)).click();
//show the overlay again
$(this).css('display','block');
});
$('.duck_ie_again').click(function(e)) {
$(this).parent().trigger(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment