0.0.15 • Published 5 years ago

@modernice/animate-height v0.0.15

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

animate-height

Animate the height of an element to 'auto' or '0px'.

Install

CDN

<script src="https://unpkg.com/animate-height"></script>

Node

npm install animate-height --save # or yarn add animate-height

Usage

Animate to auto

import { autoHeight } from 'animate-height'

const el = document.querySelector('#example')

const height = await autoHeight(el, {
  duration: 250,
  timing: 'cubic-bezier(.91, .06, .08, .93)',
})

console.log(`Element has a height of ${height}px.`)

Animate to 0px

import { zeroHeight } from 'animate-height'

const el = document.querySelector('#example')

await zeroHeight(el, {
  duration: 500,
  timing: 'ease-out',
})

Default options

autoHeight(el, {
  duration: 300, // Transition duration
  timing: 'ease', // CSS transition timing function
})
0.0.15

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago