npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

remote-slick-slider-nav

v1.0.1

Published

A custom jQuery plugin that turns any HTML element into a remote navigation control for Slick Slider by Ken Wheeler. It allows seamless interaction with the slider, offering full control over navigation with responsive design support. The plugin provides

Downloads

123

Readme

Remote-Slick-Slider-Nav for Slick Slider

Overview

A custom jQuery plugin that turns any HTML element into a remote navigation control for Slick Slider by Ken Wheeler. It allows seamless interaction with the slider, offering full control over navigation with responsive design support. The plugin provides customization options for navigation behavior, including adjustable scroll settings, item visibility modifiers, and responsive adjustments based on screen size.

Features

  • Transform any element into Slick Slider Navigation: This plugin allows you to create custom navigation for Slick Slider, turning any element into interactive navigation dots or buttons that sync with the slider.
  • Responsive Support:: Define breakpoints to modify the behavior of the navigation on different screen sizes, including the number of items to scroll and modifier values.
  • Customizable:: Easily adjust the navigation behavior through options like modifier (for number of items to hide), toScroll (how many items to scroll at once), and more.
  • ARIA Accessibility:: The plugin ensures that the navigation buttons are accessible, with proper ARIA attributes for screen readers.
  • Dynamic Updates:: The plugin reacts to changes in screen size and updates the navigation accordingly.

Installation

1. Include jQuery and Slick Slider

Make sure you have jQuery and the Slick Slider installed and initialized before using this plugin. You can include the necessary files like this:

<!-- Include jQuery -->
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>

<!-- Include Slick Slider -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/[email protected]/slick/slick.css"/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/slick/slick.min.js"></script>

2. Include the Plugin Script

Include the RemoteSlickSliderNav plugin script after the Slick Slider script:

<script src="path/to/dist/remote-slick-slider-nav.min.js"></script>

Usage

Basic Initialization

To initialize the RemoteSlickSliderNav plugin, call it on the container element where you want the navigation to appear. Ensure the target Slick Slider is already initialized, or invoke it during the Slick Slider's init event. Specify the slider option to link your Slick Slider, and optionally customize the settings to fit your needs.

Container element:

<div class="slider-nav"></div>

Script:

$(".slider-nav").remoteSlickSliderNav({
    slider: ".dine-slider",  // The Slick Slider to control
    className: "custom-dots-class",  // Custom class name for navigation dots (optional)
    modifier: 0,  // Number of items to exclude from navigation
    toScroll: 1,  // Number of items to scroll at a time
    responsive: [
        { breakpoint: 768, settings: { modifier: 1, toScroll: 2 } },
        { breakpoint: 992, settings: { modifier: 0, toScroll: 1 } }
    ]
});

Options

  • slider: The jQuery selector for the Slick Slider (e.g., ".dine-slider").
  • className: The CSS class for the navigation dots container (default: slick-dots). You can provide a custom class name here.
  • modifier: The number of items to exclude from the navigation.
  • toScroll: The number of items to scroll at a time when navigating through the slides.
  • responsive: An array of objects containing breakpoints and custom settings for different screen sizes.

Example:

responsive: [
    { breakpoint: 768, settings: { modifier: 1, toScroll: 2 } },
    { breakpoint: 992, settings: { modifier: 0, toScroll: 1 } }
]

In the above example:

  • Breakpoint 768px: Excludes 1 item from navigation (modifier: 1), scrolls 2 items at a time (toScroll: 2).
  • Breakpoint 992px: Excludes no items (modifier: 0), scrolls 1 item at a time (toScroll: 1).

Methods

destroy()

Destroys the navigation and removes all generated elements. Can be used to clean up when the navigation is no longer needed.

instance.destroy();

Responsive Behavior

The plugin adjusts the modifier and toScroll values dynamically based on the screen size. If the window width crosses a defined breakpoint, the plugin reinitializes the navigation with the new settings.

Important: When resizing the window, the plugin checks the current breakpoint and applies the appropriate settings, ensuring the navigation works as expected on all screen sizes.

Credit

This plugin is developed by adhit28.

For any questions or issues, feel free to reach out via email: [email protected].

License

This plugin is released under the MIT License. Feel free to use and modify it for your projects.