Skip to content

cihad/match-position

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Match Position

Moves one element to another element based on corner points.

It uses css transform property.

Demo: https://cihad.github.io/match-position/demo

animation of match position

For Installation

For node package:

npm install match-position

or for browser:

<script src="http://unpkg.com/match-position"></script>

Usage

Think you have two divs like this:

<div id="a"></div>
<div id="b"></div>

You want to match div-a to div-b according corner points.

const { a, b } = window

MatchPosition.matchPosition({ a, aPos: "lt", b, bPos: "rt" })

That's it. It's simply.

About

Moves one element to another element based on corner points.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published