Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>ally.fix.pointerFocusParent Example</title>
</head>
<body>
<article id="example-introduction">
  <h1><code>ally.fix.pointerFocusParent</code> Example</h1>
  <p>There are two focusable div elements in this document, each containing a link. The first div element and link exhibit the undesired behavior upon click, the second div element and link are covered by <code>ally.fix.pointerFocusParent</code>.</p>
</article>
<div id="example-html">
  <main>
    <h2>Natural Browser Behavior</h2>
    <div tabindex="-1">
      <a href="#example-introduction">some link</a>
    </div>
    <h2>Fixed Behavior</h2>
    <div tabindex="-1" id="fix-pointer-focus">
      <a href="#example-introduction">some link</a>
    </div>
  </main>
</div>
<script src="https://cdn.jsdelivr.net/ally.js/1.4.1/ally.min.js"></script>
</body>
</html>
 
body :focus {
  outline: 3px solid red;
}
  
 
ally.fix.pointerFocusParent({
  context: '#fix-pointer-focus',
});
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
rodneyrehmpro
0viewers