Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jquery-keyboard-focus

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jquery-keyboard-focus

Adds the provided classes to an element when it is focused by keyboard interactions (and not mouse interactions).

  • 0.0.3
  • npm
  • Socket score

Version published
Weekly downloads
222
increased by29.82%
Maintainers
1
Weekly downloads
 
Created
Source

jquery-keyboard-focus

Demo

Open index.html, or see the jsFiddle demo.

Usage

Pass in the class you want to add when an element is focused by the keyboard to $.fn.keyboardFocus.

To remove handlers, use offKeyboardFocus.

$('.keyboard-interactions-only').keyboardFocus('is-focused');
$('.keyboard-interactions-only').offKeyboardFocus();


// Or, if you have dynamic elements and want to apply your focus class to all
// elements that match a given selector:
$.keyboardFocus({
  'a.keyboard-interactions-only': 'is-focused'
  // You can specify multiple class name mappings.
});

// And, similarly, to remove keyboard focus handlers:
$.offKeyboardFocus();

Installation

bower install jquery-keyboard-focus

or

npm install jquery-keyboard-focus

Include jquery.keyboard-focus.min.js in your source.

Keywords

FAQs

Package last updated on 28 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc