Last active
November 15, 2018 17:12
-
-
Save ybelenko/425fd9c198b44f4a353f8bd16aa16eb2 to your computer and use it in GitHub Desktop.
Few jQuery helpers to set elements inside Google Map not to be interactable by TAB key
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
function disableGoogleMapsTab(mapId) { | |
$(mapId).find('a, button, div[tabindex], iframe').each(function(index, item) { | |
item.setAttribute('tabindex', -1) | |
}) | |
} | |
function enableGoogleMapsTab(mapId) { | |
$(mapId).find('a, button, iframe').each(function(index, item) { | |
item.removeAttribute('tabindex') | |
}) | |
$(mapId).find('div [tabindex]').each(function(index, item) { | |
item.setAttribute('tabindex', '0') | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment