Skip to content

Instantly share code, notes, and snippets.

@ybelenko
Last active November 15, 2018 17:12
Show Gist options
  • Save ybelenko/425fd9c198b44f4a353f8bd16aa16eb2 to your computer and use it in GitHub Desktop.
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
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