🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

longest-transition

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

longest-transition

Cross-browser longest transition getter

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

longest-transition

NPM version Downloads Build Status Coverage Status Dependency status Dev Dependency status

Cross-browser longest transition getter.

This module reads all transitions of an element and provides the longest one.

import longestTransition from 'longest-transition';
// or
const longestTransition = window.longestTransition;

const element = document.getElementById('transitioning-element');

const time = longestTransition(element);
/*
    `time` will be something like:

    {
        property: 'height',
        duration: 200,
        delay: 100
    }

    Note that time is in milliseconds
*/

Installation

$ npm install longest-transition

Usage

longestTransition(element)
  • element: The element that is transitioning.
  • Returns an object in the format below.
{
    property: 'height',
    duration: 200, // milliseconds
    delay: 100  // milliseconds
}

Tests

$ npm test
$ npm test-cov to get coverage report

License

Released under the MIT License.

Keywords

transition

FAQs

Package last updated on 30 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts