diff --git a/js/cell.js b/js/cell.js index 5cb402d9..030c5ebd 100644 --- a/js/cell.js +++ b/js/cell.js @@ -39,7 +39,7 @@ var proto = Cell.prototype; proto.create = function() { this.element.style.position = 'absolute'; - this.element.setAttribute( 'aria-selected', 'false' ); + this.element.setAttribute( 'aria-hidden', 'true' ); this.x = 0; this.shift = 0; }; @@ -48,7 +48,7 @@ proto.destroy = function() { // reset style this.element.style.position = ''; var side = this.parent.originSide; - this.element.removeAttribute('aria-selected'); + this.element.removeAttribute( 'aria-hidden' ); this.element.style[ side ] = ''; }; diff --git a/js/slide.js b/js/slide.js index 9515bf8e..c8cfa7cc 100644 --- a/js/slide.js +++ b/js/slide.js @@ -63,7 +63,11 @@ proto.changeSelected = function( isSelected ) { var classMethod = isSelected ? 'add' : 'remove'; this.cells.forEach( function( cell ) { cell.element.classList[ classMethod ]('is-selected'); - cell.element.setAttribute( 'aria-selected', isSelected.toString() ); + if ( isSelected ) { + cell.element.removeAttribute( 'aria-hidden' ); + } else { + cell.element.setAttribute( 'aria-hidden', 'true' ); + } }); };