Итак, у меня есть следующая функция. Он прослушивает событие фокуса для всех элементов. Если этот элемент находится либо в
Код: Выделить всё
$mobileMenuКод: Выделить всё
$menuItemsКод: Выделить всё
var $body = $("body");
var $mobileMenu = $("#mobile-menu");
var $menuItems = $("#main-menu a");
$body.on("focus.spf", "*", function(e){
e.stopPropagation();
$this = $(this);
// Prevent items from recieving focus and switching view
if (!$this.is($mobileMenu) && !$this.is($menuItems)) {
$this.blur();
} else {
console.log(this);
}
})
Does anyone know how I can tell it to instead skip to the next focusable element?
Источник: https://stackoverflow.com/questions/209 ... ving-focus
Мобильная версия