New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

keen-slider

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

keen-slider

The HTML touch slider carousel with the most native feeling you will get.

6.8.6
latest
Source
npm
Version published
Weekly downloads
192K
-5.66%
Maintainers
1
Weekly downloads
 
Created

What is keen-slider?

keen-slider is a lightweight, responsive, and touch-enabled slider library for creating carousels and sliders in web applications. It is highly customizable and supports various features such as navigation, autoplay, and different types of animations.

What are keen-slider's main functionalities?

Basic Slider

This code initializes a basic slider on an element with the ID 'my-slider'.

const slider = new KeenSlider('#my-slider');

Navigation

This code initializes a slider with looping enabled and adds event listeners to 'prev' and 'next' buttons to navigate through the slides.

const slider = new KeenSlider('#my-slider', { loop: true });
document.getElementById('prev').addEventListener('click', () => slider.prev());
document.getElementById('next').addEventListener('click', () => slider.next());

Autoplay

This code initializes a slider with looping enabled and sets it to autoplay with a duration of 2000 milliseconds between slides.

const slider = new KeenSlider('#my-slider', { loop: true, duration: 2000 });

Responsive Design

This code initializes a slider that adjusts the number of slides visible based on the screen width, making it responsive.

const slider = new KeenSlider('#my-slider', { breakpoints: { '(min-width: 768px)': { slidesPerView: 2 }, '(min-width: 1024px)': { slidesPerView: 3 } } });

Other packages similar to keen-slider

Keywords

slider

FAQs

Package last updated on 05 Jul 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