All Projects → nico3333fr → jquery-accessible-simple-tooltip-aria

nico3333fr / jquery-accessible-simple-tooltip-aria

Licence: MIT license
jQuery accessible simple tooltip window, using ARIA

Projects that are alternatives of or similar to jquery-accessible-simple-tooltip-aria

van11y-accessible-simple-tooltip-aria
ES2015 accessible simple tooltip, using ARIA
Stars: ✭ 22 (+0%)
Mutual labels:  accessibility, a11y, aria, tooltip
A11y tooltips
Accessible Tooltip Component
Stars: ✭ 35 (+59.09%)
Mutual labels:  accessibility, a11y, aria, tooltip
Js Offcanvas
A lightweight, flexible jQuery off-canvas navigation plugin which lets you create fully accessible sidebar or top/bottom sliding (or push) panels with keyboard interactions and ARIA attributes.
Stars: ✭ 272 (+1136.36%)
Mutual labels:  jquery-plugin, accessibility, a11y, aria
Accessible modal window
Accessible modal dialogs
Stars: ✭ 196 (+790.91%)
Mutual labels:  accessibility, a11y, aria
Eslint Plugin Jsx A11y
Static AST checker for a11y rules on JSX elements.
Stars: ✭ 2,609 (+11759.09%)
Mutual labels:  accessibility, a11y, aria
jquery-accessible-carrousel-aria
jQuery Accessible Carrousel System, using ARIA
Stars: ✭ 40 (+81.82%)
Mutual labels:  accessibility, a11y, aria
Creatability Components
Web components for making creative tools more accessible.
Stars: ✭ 248 (+1027.27%)
Mutual labels:  accessibility, a11y, aria
jquery-accessible-modal-window-aria
jQuery simple and accessible modal window, using ARIA
Stars: ✭ 61 (+177.27%)
Mutual labels:  accessibility, a11y, aria
van11y-accessible-hide-show-aria
ES2015 accessible hide-show system (collapsible regions), using ARIA
Stars: ✭ 34 (+54.55%)
Mutual labels:  accessibility, a11y, aria
Van11y Accessible Tab Panel Aria
ES2015 accessible tabs panel system, using ARIA
Stars: ✭ 58 (+163.64%)
Mutual labels:  accessibility, a11y, aria
Accessible Html Content Patterns
♿️ The full HTML5 Doctor Element Index as well as common markup patterns for quick reference.
Stars: ✭ 93 (+322.73%)
Mutual labels:  accessibility, a11y, aria
jquery-accessible-dialog-tooltip-aria
jQuery simple and accessible dialog tooltip window, using ARIA
Stars: ✭ 17 (-22.73%)
Mutual labels:  accessibility, aria, tooltip
a11y-accordion-tabs
A script for an accessible accordion tabs component
Stars: ✭ 50 (+127.27%)
Mutual labels:  accessibility, a11y, aria
alfa
♿ Suite of open and standards-based tools for performing reliable accessibility conformance testing at scale
Stars: ✭ 75 (+240.91%)
Mutual labels:  accessibility, a11y, aria
aria-collapsible
A lightweight, dependency-free JavaScript module for generating progressively-enhanced collapsible regions using ARIA States and Properties.
Stars: ✭ 25 (+13.64%)
Mutual labels:  accessibility, a11y, aria
enabler
✋ Accessibility analyzer for your frontend.
Stars: ✭ 19 (-13.64%)
Mutual labels:  accessibility, a11y, aria
aria-at
Assistive Technology ARIA Experience Assessment
Stars: ✭ 115 (+422.73%)
Mutual labels:  accessibility, a11y, aria
Accessible components
Listing of accessible components & patterns
Stars: ✭ 393 (+1686.36%)
Mutual labels:  accessibility, a11y, aria
Accordion
Accordion module created in pure javascript & CSS. Very useful to create FAQ lists on your website.
Stars: ✭ 94 (+327.27%)
Mutual labels:  accessibility, a11y, aria
Skin
Pure CSS framework designed & developed by eBay for a branded, e-commerce marketplace.
Stars: ✭ 126 (+472.73%)
Mutual labels:  accessibility, a11y, aria

jQuery accessible simple tooltip window, using ARIA

This jQuery plugin will provide you an accessible and simple non-modal tooltip, using ARIA.

Installation

You can download and install the plugin via:

  • npm: $ npm i jquery-accessible-simple-tooltip-aria
  • bower: $ bower install jquery-accessible-simple-tooltip-aria

Demo

The demo is here: https://a11y.nicolas-hoffmann.net/simple-tooltip/

Why it is accessible

  • It relies on ARIA Design pattern for Tooltips;
  • Thanks to aria-describedby and ids generated on the fly, you never loose any information;
  • You can close it using Esc.

How it works

Default

Basically, the scripts wraps each class="js-simple-tooltip" into a span class="<your-prefix-class>-container" and adds the content into a hidden content next to it. Once you focus or hover the element with class="js-simple-tooltip", it is displayed.

You can use it on the tag you want (input, button, a…)

jQuery Plugin

$('div').accessibleSimpleTooltipAria({
  simpletooltipText: title
});

License

No license problem, it uses MIT license, so it’s free, open-source and you can do whatever you want with it, including commercial use (permission notice)

Options and attributes

Use data-simpletooltip-text or data-simpletooltip-content-id attributes on an element to activate the tooltip.

  • Simply put class="js-simpletooltip" on a button to activate the script.
  • Attribute data-simpletooltip-prefix-class (non mandatory): the prefix to all style classes of the tooltip (useful to set up different styles).
  • Attribute data-simpletooltip-text: the text of your tooltip.
  • Attribute data-simpletooltip-content-id: the id of (hidden) content in your page that will be put into your tooltip.
  • Attribute data-simpletooltip-wrapper-tag: the tag used for wrapping your tooltip (span by default).
  • Attribute data-simpletooltip-tag: the tag used for your tooltip (span by default).

How to style it

/* it will work better with this box-sizing, you may adapt it to your needs */
/*html { box-sizing: border-box; }
*, *:before, *:after {
  box-sizing: inherit;
}*/

/* Tooltip hidden by default */
.simpletooltip[aria-hidden="true"],
.minimalist-simpletooltip[aria-hidden="true"],
.minimalist-left-simpletooltip[aria-hidden="true"] {
  display: none;
}
/* position relative for containers */
.simpletooltip_container,
.minimalist-simpletooltip_container,
.minimalist-left-simpletooltip_container {
  position: relative;
  display: inline;
}

/* tooltip styles */
.simpletooltip,
.minimalist-simpletooltip,
.minimalist-left-simpletooltip {
  position: absolute;
  display: inline-block;
  z-index: 666;
  width: 10em;
  border-radius: .5em;
  background: rgba( 0, 0, 0, .9 );
  color: #eee;
  padding: .5em;
  text-align: left;
  line-height: 1.3;
}
.simpletooltip,
.minimalist-simpletooltip {
  right: auto;
  left: 100%;
  margin-left: .5em;
}
.minimalist-left-simpletooltip {
  right: 100%;
  left: auto;
  margin-right: .5em;
}
/* used pseudo-element to make arrows */
.simpletooltip::before,
.minimalist-simpletooltip::before,
.minimalist-left-simpletooltip::before {
  content: '';
  speak: none;
  position: absolute;
  z-index: 666;
  width: 10px;
  height: 10px;
}
.simpletooltip::before,
.minimalist-simpletooltip::before {
  top: .5em;
  left: -10px;
  margin-left: -10px;
  border: 10px solid transparent;
  border-right: 10px solid rgba( 0, 0, 0, .9 );
}
.minimalist-left-simpletooltip::before {
  top: .5em;
  right: -10px;
  margin-right: -10px;
  border: 10px solid transparent;
  border-left: 10px solid rgba( 0, 0, 0, .9 )
}

/* it can be easily adapted in media-queries for tablets/mobile */

/* for this example: mobile */
@media (max-width: 44.375em) {

  .simpletooltip,
  .minimalist-simpletooltip,
  .minimalist-left-simpletooltip  {
    top: 100%;
    left: 50%;
    right: 0;
    margin: 0;
    margin-top: .7em;
    margin-left: -5em;
  }
  .simpletooltip::before,
  .minimalist-simpletooltip::before,
  .minimalist-left-simpletooltip::before  {
    top: -10px;
    right: auto;
    left: 50%;
    margin-left: -5px;
    margin-top: -10px;
    border: 10px solid transparent;
    border-bottom: 10px solid rgba( 0, 0, 0, .9 );
  }

}

examples

<button class="js-simple-tooltip"
 data-simpletooltip-text="Cool, it works!">
  Hover or focus me to show the tooltip
</button>

<button class="js-simple-tooltip"
 data-simpletooltip-content-id="tooltip-case_1">
  Show me another tooltip
</button>
<div id="tooltip-case_1" class="hidden">Woot, you can take the content of a hidden block.</div>

Enjoy.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].