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>Failing Focus in Animated UI</title>
</head>
<body>
<article id="example-introduction">
  <h1>Failing Focus in Animated UI</h1>
  <p>This example shows the basic concept of a carousel, accordion and similar content-revealing UI widgets.</p>
  <p>
    The buttons reveal their associated slides by using the CSS properties <code>transform</code> and <code>transition</code>.
    The checkbox controls if focus should be shifted to the slide as it is revealed.
  </p>
  <p>Note how shifting focus interferes with the content being presented, because of the browser scrolling elements into view when they become the active element.</p>
</article>
<div id="example-html">
  <main>
    <section data-active-item="first">
      <fieldset>
        <legend>show slide</legend>
        <p>
          <button type="button" data-show="first">first</button>
          <button type="button" data-show="second">second</button>
          <button type="button" data-show="third">third</button>
        </p>
        <p>
          <label><input type="checkbox" id="with-focus"> shift focus to slide</label>
        </p>
        <p>
          <button type="button" id="reset">reset scroll position</button>
        </p>
      </fieldset>
      <div id="cropper">
        <ul>
          <li id="first" tabindex="-1">First</li>
          <li id="second" tabindex="-1">Second</li>
          <li id="third" tabindex="-1">Third</li>
        </ul>
      </div>
    </section>
  </main>
</div>
</body>
</html>
Output

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

Dismiss x
public
Bin info
rodneyrehmpro
0viewers