A lightweight, modern and customizable JavaScript slider library.

Overview

NSlider

NSlider is a lightweight (< 10 KB), modern and customizable JavaScript slider library.


CDN

Development

https://cdn.jsdelivr.net/gh/fatihege/[email protected]/src/js/nslider.js

https://cdn.jsdelivr.net/gh/fatihege/[email protected]/src/css/nslider.css

Production

https://cdn.jsdelivr.net/gh/fatihege/[email protected]/src/js/nslider.min.js

https://cdn.jsdelivr.net/gh/fatihege/[email protected]/src/css/nslider.min.css


Sample Usage

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>NSlider</title>
    <link rel="stylesheet" href="nslider.min.css">
    <!-- Custom styling for slider to look neat. -->
    <style>
        .nslider {
            width: 500px;
            height: 200px;
            background-color: #e2e2e2;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="nslider">
        <div class="nslider-wrapper">
            <div class="nslider-slide" id="slide-1">
                Slide 1
            </div>
            <div class="nslider-slide" id="slide-2">
                Slide 2
            </div>
            <div class="nslider-slide" id="slide-3">
                Slide 3
            </div>
        </div>
        <div class="nslider-button nslider-button-prev"></div>
        <div class="nslider-button nslider-button-next"></div>
    </div>
</div>
<script src="nslider.min.js"></script>
<script>
    const slider = new NSlider({ // Only 'elem' key required.
        elem: document.querySelector('.container'), // A parent element of the slider
        // NOTE: The specified parent element can have only 1 NSlider.
        
        // animation: true, // Animation opens with default settings
        
        animation: { // Custom Animation Options
             duration: 1000, // Milliseconds
             timingFunction: 'ease-in' // CSS's animation timing functions
        },
        
        keyboardControl: true, // Slider can be controlled with right and left arrows
        // currentSlide: 2, // Current slide index. It starts from 0 because it is in array logic
        // prevButtonInner: '<', // Custom "previous" button content
        // nextButtonInner: '>', // Custom "next" button content
        dots: true, // Dots as the number of slides below the slider
    });
    
    // Optional
    setInterval(() => slider.next(), 5000); // Every 5 seconds the slider automatically moves to the next slide
    // setInterval(() => slider.prev(), 5000); // Every 5 seconds the slider automatically moves to the previous slide
</script>
</body>
</html>
You might also like...

A Responsive JQuery Slider

Turntable.js :: A Responsive JQuery Slider A jQuery plugin that will flip through a list of images as your mouse sweeps across a container Usage All i

Nov 1, 2022

Smooth mobile touch slider for Mobile WebApp, HTML5 App, Hybrid App

Smooth mobile touch slider for Mobile WebApp, HTML5 App, Hybrid App

iSlider iSlider is a lightweight, high-performant, no library dependencies cross-platform slide controller. It can help handling most sliding effects,

Nov 25, 2022

Swipe is the most accurate touch slider.

Usage Swipe only needs to follow a simple pattern. Here is an example: div id='slider' class='swipe' div class='swipe-wrap' div/div

Dec 16, 2022

A very simple image slider that will responsively work with images of any size or shape

Square1 A very simple image slider that will responsively work with images of any size or shape. requires jQuery Demo Installation Link to jQuery sc

May 20, 2022

UI slider control that magnifies the current value

UI slider control that magnifies the current value

jquery-rsSliderLens Renders a powerfull input range control. With minor differences, all browsers render an input type="range" / pretty much the sam

Apr 22, 2022

Tool Cool Range Slider

Tool Cool Range Slider

Responsive range slider library written in typescript and using web component technologies. Pure JavaScript without additional dependencies. It has a rich set of settings, including a vertical slider, touch, mousewheel and keyboard support, local and session storage, and RTL support.

Dec 31, 2022

Rotating slider for selecting numerical values.

Rotating slider for selecting numerical values. Allows mobile friendly precise selection for value from selected range with desired step. Component is especially useful for hybrid application using frameworks like Ionic, Cordova or PhoneGap.

Sep 27, 2022

This simple library allows you to create awesome responsive and highly customizable popups importing just one JavaScript file.

Creativa - Popup This is a simple library that allows you to create awesome popups importing just one JavaScript file. Getting started You can import

Mar 29, 2022

The JavaScript library let’s you transform native tooltip’s into customizable overlays.

iTooltip The JavaScript library let’s you transform native tooltip’s into customizable overlays. Use: script src="/path/to/iTooltip.js"/script sc

Dec 17, 2021
Releases(v1.0.0)
Owner
Fatih
Web Developer / Designer
Fatih
A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more

Glide.js is a dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more What can co

null 6.7k Jan 3, 2023
A customizable lightweight Alert Library with Material UI and awesome features.

SoloAlert A customizable lightweight Alert Library with Material UI and awesome features. view soloalert on npm : https://www.npmjs.com/soloalert Inst

Arnav Kumar 21 Nov 30, 2022
MenuSlider-Javascript - How to create a menu slider with vanilla javascript

MenuSlider-Javascript How to create a menu slider with vanilla javascript Instal

Tarokh Mohammadi 1 Feb 8, 2022
Collection of customizable Anki flashcard templates with modern and clean themes.

Anki Templates Collection of customizable Anki flashcard templates with modern and clean themes. About Features Themes Instructions Add-on support Com

Pranav Deshai 101 Dec 29, 2022
LogTure - A minimal designed, fully customizable, and extensible modern personal blogging framework, built with Nextjs.

LogTure - A minimal designed, fully customizable, and extensible modern personal blogging framework, built with Nextjs.

Sam Zhang 14 Aug 26, 2022
Pure JavaScript HTML5 Canvas Range Slider. No stylesheet needed. Simple, elegant and powerful. A quirky alternative to other sliders.

CanvasSlider CanvasSlider is a lightweight JavaScript range slider. Most of the range slider controls use Javascript and a stylesheet. This slider use

null 7 Aug 15, 2022
Slide everything into this vanilla javascript slider: just 20kb all-inclusive, no dependencies!

Lightweight vanilla javascript media and contents slider, by LCweb Just 20KB to have: Top features list: single file, no dependencies, 100% pure javas

Luca 4 May 12, 2021
EggyJS is a Javascript micro Library for simple, lightweight toast popups focused on being dependency-less, lightweight, quick and efficient.

EggyJS EggyJS is a Javascript micro Library for simple, lightweight toast popups. The goal of this library was to create something that meets the foll

Sam 10 Jan 8, 2023
A modern solidjs based UI library ~ it is very lightweight!

?? 目前正在开发中,敬请期待~ cerises-ui 一个现代的基于 solidjs 的 UI 库~它是非常轻量级的! 官网:https://cerises-ui.edoc.wiki 目前计划组件 组件 说明 认领人 进度 Review & Unit Test Button、ButtonGroup

Cerises UI 4 Jul 19, 2022
Lightweight, Modern Multicall3 Typescript Library

pilum • Lightweight, Modern Multicall3 Typescript Library published on npm. Multicall3 flexibly aggregates results from multiple smart contract functi

null 26 Nov 15, 2022