Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. const fold = async (content, direction = "normal") => {
  2. const scrollHeight = content.scrollHeight
  3. await animate({
  4. ...timing,
  5. direction,
  6. elements: content,
  7. opacity: [0, 1],
  8. maxHeight: ['0px', scrollHeight + 'px'],
  9. transform: ["scaleY(0)", 1],
  10. paddingTop: ['0em', '2em'], // add this
  11. paddingBottom: ['0em', '2em'] // add this
  12. })
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement