Socket
Book a DemoInstallSign in
Socket

flickity-as-nav-for

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flickity-as-nav-for

Enable asNavFor for Flickity

3.0.0
latest
Source
npmnpm
Version published
Weekly downloads
9.3K
7.27%
Maintainers
1
Weekly downloads
 
Created
Source

Flickity asNavFor

Enables asNavFor option for Flickity, where one gallery is navigation or another.

  • Clicking the nav gallery will select the content gallery
  • Selecting the content gallery will sync to the nav gallery
<div class="gallery gallery-a">
  ...
</div>
<div class="gallery gallery-b">
  ...
</div>
// options
asNavFor: '.gallery-a'
// set as a selector string

asNavFor: document.querySelector('.gallery-a')
// set as an element

Install

Add as-nav-for.js to your scripts, after including Flickity.

Download

CDN

<script src="https://unpkg.com/flickity-as-nav-for@2/as-nav-for.js"></script>

Package managers

npm: npm install flickity-as-nav-for

Yarn: yarn add flickity-as-nav-for

Usage

jQuery

$('.gallery-a').flickity();
$('.gallery-b').flickity({
  asNavFor: '.gallery-a'
});

Vanilla JS

var flktyA = new Flickity('.gallery-a');
var flktyB = new Flickity( '.gallery-b', {
  asNavFor: '.gallery-a'
});

HTML

<div class="gallery gallery-a js-flickity">
  ...
</div>
<div class="gallery gallery-b js-flickity"
  data-flickity-options='{ "asNavFor": ".gallery-a" }'>
  ...
</div>

Install

Bower: bower install flickity-as-nav-for --save

npm: npm install flickity-as-nav-for

Webpack

const Flickity = require('flickity');
require('flickity-as-nav-for');

var flktyA = new Flickity('.gallery-a');
var flktyB = new Flickity( '.gallery-b', {
  asNavFor: '.gallery-a'
});

MIT license

By Metafizzy

Keywords

flickity

FAQs

Package last updated on 06 Mar 2022

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.