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

How to reinit height? #16

Closed Venegrad closed 3 years ago

Venegrad commented 3 years ago

If ill use slideDown, and after inside element change height (like add some items in spoiler), after slideUp and slideDOwn will bug, because start animation from old height.

BrentonCozby commented 3 years ago

@Venegrad the library was caching the height, but I saw no good reason to do this since the height is calculated every time a slide is triggered. Therefore, I removed the cached height so it now uses the latest height every time. I've also updated the example to include dynamic heights. Thanks for reporting this issue. You can download the fixed library with v2.2.0.