🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more →
Socket
Book a DemoInstallSign in
Socket

abbr-touch

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abbr-touch

Makes element title attributes touch accessible

latest
Source
npmnpm
Version
2.1.6
Version published
Maintainers
1
Created
Source

abbr-touch NPM version

Build Status Code Climate

abbr-touch is a tiny JavaScript library that makes the title attribute of <abbr> element touch accessible. It does so by utilising touchtap-event to only expose the functionality to touch-enabled devices, a custom touch handler can then be used to display <abbr>'s content any way you wish.

Example usage: touching an <abbr> tag brings up a description

Install

npm install --save abbr-touch

Include

<script src="node_modules/abbr-touch/abbr-touch.js"></script>

Usage

// default handler on document (alert)
abbrTouch();

// default handler, apply to descendants of #some-element
abbrTouch(document.querySelector('#some-element'));

// custom handler, apply to descendants of #some-element
abbrTouch(document.querySelector('#some-element'), myHandler);

function myHandler(target, title, touchX, touchY) {
  console.log(target);
  console.log(title);
  console.log(touchX);
  console.log(touchY);
}

A deeper example of usage can be found in demo.html. A live demo can be viewed on Growing with the Web.

See also

Keywords

touch

FAQs

Package last updated on 14 Nov 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