Created
April 18, 2016 16:23
-
-
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.
This file contains 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 characters
.pointer-events-on-click { cursor: pointer; } | |
.pointer-events-on-click iframe { pointer-events: none; } |
This file contains 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 characters
$('.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