2.1.6 • Published 10 years ago

abbr-touch v2.1.6

Weekly downloads
8
License
MIT
Repository
github
Last release
10 years ago

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

2.1.6

10 years ago

2.1.5

10 years ago

2.1.4

10 years ago

2.1.3

10 years ago

2.1.2

10 years ago

2.1.1

10 years ago

2.1.0

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.0

10 years ago