Skip to content

Instantly share code, notes, and snippets.

@robspangler
Created April 18, 2016 16:23
Show Gist options
  • Save robspangler/30b6f74de457a758efa86b1610f5442a to your computer and use it in GitHub Desktop.
Save robspangler/30b6f74de457a758efa86b1610f5442a to your computer and use it in GitHub Desktop.
Disables mouse events on iFrames (e.g. Google Maps) until clicked on. This is especially useful for disabling the scroll wheel.
.pointer-events-on-click { cursor: pointer; }
.pointer-events-on-click iframe { pointer-events: none; }
$('.pointer-events-on-click').click(function () {
$('.pointer-events-on-click iframe').css("pointer-events", "auto");
$(this).removeClass('pointer-events-on-click');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment