Skip to content

Instantly share code, notes, and snippets.

@Alex1990
Last active November 30, 2015 06:56
Show Gist options
  • Select an option

  • Save Alex1990/230fec6f85daea2cee84 to your computer and use it in GitHub Desktop.

Select an option

Save Alex1990/230fec6f85daea2cee84 to your computer and use it in GitHub Desktop.
/**
* Add `:tabbable` selector. (From jQuer UI)
* focusable: https://gist.github.com/Alex1990/f086a23bca98672486ca
*/
$.extend($.expr[':'], {
tabbable: function(element) {
var tabIndex = $(element).attr('tabindex');
var hasTabIndex = tabIndex != null;
return (!hasTabIndex || tabIndex > 0) && $.expr[':'].focusable(element);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment