BrentonCozby / dom-slider

Plain JavaScript version of jQuery's slideToggle(), slideDown(), & slideUp(), but does not use display: none.
MIT License
61 stars 7 forks source link

Use requestAnimationFrame #10

Closed julkue closed 4 years ago

julkue commented 4 years ago

This would be better than e.g. setTimeout:

https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame

BrentonCozby commented 4 years ago

Good thinking, but I don't think requestAnimationFrame can replace setTimeout in this instance. I'm using setTimeout to delay the beginning of a CSS transition.