New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

fly-to

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fly-to

Fly a DOM element to another element

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
5
400%
Maintainers
1
Weekly downloads
 
Created
Source

FlyTo

Fly a DOM element to another element.

View Online Demo



NPM



Table of Contents

Installation

[A] Download

[B] Package

  • Install with yarn: yarn add fly-to

  • Install with npm: npm install fly-to

  • NPM

[C] Get a local working copy of the development repository (Optional)
git clone https://github.com/Rodgath/fly-to.git

Implementation

Initializing with flyTo function. View Demo

Your HTML markup.

<div class="fly-to-element"></div>
<div class="flying-element"></div>

Call the flyTo() function with two arguments.

...1) The flying element object using its 'class' or 'id'.

...2) The target element object using its 'class' or 'id'.

document.addEventListener('DOMContentLoaded', function() {
  
  const flyingElement = document.querySelector('.flying-element');
  const flyToElement = document.querySelector('.fly-to-element');

  flyTo(flyingElement, flyToElement);
  
});

Enqueue the flyTo script at the bottom of your markup

  • Using local script file.
<script src="fly-to.min.js"></script>
<!-- OR -->
<script src="./node_modules/fly-to/dist/js/fly-to.min.js"></script>
  • Using CDN file. (Optional)
<script src="https://cdn.jsdelivr.net/npm/fly-to@latest/dist/js/fly-to.min.js"></script>

License

flyTo is an open-source project released under the MIT license.

Crafted by Rodgath

Keywords

fly-element

FAQs

Package last updated on 17 Sep 2023

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