Last active
August 18, 2017 17:36
-
-
Save crossan007/9830e6a5a1af91191f6ca4faf8a4ac43 to your computer and use it in GitHub Desktop.
CSS Class Based TabIndex
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 setTabIndex() | |
{ | |
NWF$("[class^='ts-']").each(function(i,ele) { | |
var tabIndex = parseInt(ele.className.match(/ts-(-?\d?)/)[1]); | |
NWF$(ele).attr("tabindex",tabIndex); | |
console.log("set Tabindex " + tabIndex); | |
}); | |
} | |
function clearTabIndex() | |
{ | |
return NWF$('[tabindex]').each(function(i,ele) { | |
NWF$(ele).attr("tabindex",""); | |
console.log("Clearing Tabindex"); | |
}).promise(); | |
} | |
NWF$(document).ready(function() | |
{ | |
clearTabIndex().done(function(){ | |
setTabIndex(); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment