function lockScreenReader(element, options) {
      var isHidden = true;

      // get raw DOM node
      walkDOM(element[0]);

      options.unlockScreenReader = function () {
        isHidden = false;
        walkDOM(element[0]);

        options.unlockScreenReader = null;
      };

      /**
       * Get all of an element's parent elements up the DOM tree
       * @return {Array} The parent elements
       */
      function getParents(element) {
        var parents = [];
        while (element.parentNode) {
          if (element === document.body) {
            return parents;
          }
          var children = element.parentNode.children;
          for (var i = 0; i < children.length; i++) {
            // skip over child if it is an ascendant of the dialog
            // a script or style tag, or a live region.
            if (element !== children[i] &&
                !isNodeOneOf(children[i], ['SCRIPT', 'STYLE']) &&
                !children[i].hasAttribute('aria-live')) {
              parents.push(children[i]);
            }
          }
          element = element.parentNode;
        }
        return parents;
      }

      /**
       * Walk DOM to apply or remove aria-hidden on sibling nodes
       * and parent sibling nodes
       */
      function walkDOM(element) {
        var elements = getParents(element);
        for (var i = 0; i < elements.length; i++) {
          elements[i].setAttribute('aria-hidden', isHidden);
        }
      }
    }
function lockScreenReader(element, options) {
      var isHidden = true;

      // get raw DOM node
      walkDOM(element[0]);

      options.unlockScreenReader = function () {
        isHidden = false;
        walkDOM(element[0]);

        options.unlockScreenReader = null;
      };

      /**
       * Get all of an element's parent elements up the DOM tree
       * @return {Array} The parent elements
       */
      function getParents(element) {
        var parents = [];
        while (element.parentNode) {
          if (element === document.body) {
            return parents;
          }
          var children = element.parentNode.children;
          for (var i = 0; i < children.length; i++) {
            // skip over child if it is an ascendant of the dialog
            // a script or style tag, or a live region.
            if (element !== children[i] &&
                !isNodeOneOf(children[i], ['SCRIPT', 'STYLE']) &&
                !children[i].hasAttribute('aria-live')) {
              parents.push(children[i]);
            }
          }
          element = element.parentNode;
        }
        return parents;
      }

      /**
       * Walk DOM to apply or remove aria-hidden on sibling nodes
       * and parent sibling nodes
       */
      function walkDOM(element) {
        var elements = getParents(element);
        for (var i = 0; i < elements.length; i++) {
          elements[i].setAttribute('aria-hidden', isHidden);
        }
      }
    }
function lockScreenReader ( element , options ) { var isHidden = true ; // get raw DOM node walkDOM ( element [ 0 ] ) ; options . unlockScreenReader = function ( ) { isHidden = false ; walkDOM ( element [ 0 ] ) ; options . unlockScreenReader = null ; } ; /**
       * Get all of an element's parent elements up the DOM tree
       * @return {Array} The parent elements
       */ function getParents ( element ) { var parents = [ ] ; while ( element . parentNode ) { if ( element === document . body ) { return parents ; } var children = element . parentNode . children ; for ( var i = 0 ; i < children . length ; i ++ ) { // skip over child if it is an ascendant of the dialog // a script or style tag, or a live region. if ( element !== children [ i ] && ! isNodeOneOf ( children [ i ] , [ 'SCRIPT' , 'STYLE' ] ) && ! children [ i ] . hasAttribute ( 'aria-live' ) ) { parents . push ( children [ i ] ) ; } } element = element . parentNode ; } return parents ; } /**
       * Walk DOM to apply or remove aria-hidden on sibling nodes
       * and parent sibling nodes
       */ function walkDOM ( element ) { var elements = getParents ( element ) ; for ( var i = 0 ; i < elements . length ; i ++ ) { elements [ i ] . setAttribute ( 'aria-hidden' , isHidden ) ; } } }
Prevents screen reader interaction behind modal window
on swipe interfaces
Prevents screen reader interaction behind modal window on swipe interfaces
Lock screen reader