Skip to content

Commit

Permalink
Pass accessibility tests. fixes jackmoore#765
Browse files Browse the repository at this point in the history
The aproach here adds button text from colorbox defaults at page
load time to avoid the following errors reported by accessibility
tests:

* wave.webaim.org:

    A button is empty or has no value text.

* HTML_CodeSniffer WCAG 2.0 Level AAA:

    This button element does not have a name available to an
    accessibility API. Valid names are: title attribute, element
    content.
  • Loading branch information
jameswilson committed Mar 28, 2017
1 parent 540e406 commit 4ae2aa9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions jquery.colorbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,13 @@
$content = $tag(div, "Content").append(
$title = $tag(div, "Title"),
$current = $tag(div, "Current"),
$prev = $('<button type="button"/>').attr({id:prefix+'Previous'}),
$next = $('<button type="button"/>').attr({id:prefix+'Next'}),
$slideshow = $('<button type="button"/>').attr({id:prefix+'Slideshow'}),
$prev = $('<button type="button">previous</button>').attr({id:prefix+'Previous'}),
$next = $('<button type="button">next</button>').attr({id:prefix+'Next'}),
$slideshow = $('<button type="button">start slideshow</button>').attr({id:prefix+'Slideshow'}),
$loadingOverlay
);

$close = $('<button type="button"/>').attr({id:prefix+'Close'});
$close = $('<button type="button">close</button>').attr({id:prefix+'Close'});

$wrap.append( // The 3x3 Grid that makes up Colorbox
$tag(div).append(
Expand Down

0 comments on commit 4ae2aa9

Please sign in to comment.