Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opaque text not always painted #158

Closed
paulrouget opened this issue Jan 29, 2016 · 1 comment
Closed

Opaque text not always painted #158

paulrouget opened this issue Jan 29, 2016 · 1 comment

Comments

@paulrouget
Copy link
Collaborator

@paulrouget paulrouget commented Jan 29, 2016

This code is supposed to animate text opacity.

Text doesn't show up until opacity reaches 1.

<script>
  setTimeout(() => {
    var div = document.querySelector(".v");
    var i = 0;
    var max = 60;
    function step() {
      if (i < max) {
        requestAnimationFrame(step);
      }
      div.style.opacity = i++ / max;
    }
    step();
  }, 1000);
</script>

<div style="width: 400px; height: 400px; padding-top: 40px; overflow: hidden; ">
  <div class="v" style="opacity: 0">FOOBAR</div>
</div>
@glennw
Copy link
Member

@glennw glennw commented Feb 2, 2016

@glennw glennw closed this Feb 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.