pretty much the sam" /> pretty much the sam" /> pretty much the sam"/>

UI slider control that magnifies the current value

Overview

jquery-rsSliderLens Build Status

Renders a powerfull input range control.

With minor differences, all browsers render an <input type="range" /> pretty much the same way:
default

Using this plugin, the same markup is rendered by default as:
sample1

or pretty much any style your imagination takes you:
sample2

Check out a demo. Also available at src/demo/demo.html

Key Features

  • Works for any markup. Although semantically the <input type="range" /> is the most appropriate markup, any other element can be used.
  • Keyboard and mouse navigation. For a markup other than <input type="range" /> to be focusable, it has to have a tabindex attribute;
  • Two types of slider:
    • Sliding type: The handle can move along the slide rail;
    • Fixed type: The handle remains in a fixed position, while the slide rail moves underneath;
  • When using the sliding type, two handles can be utilized to select ranges;
  • If desired, it can display magnified content inside the handle(s);
  • Supports both horizontal and vertical orientations;
  • Supports left to right and top to bottom directions. These directions can be reversed;
  • Either renders a rule or the markup's original content;
  • Highly customizable:
    • LESS file used to generate CSS in the color layout you wish;
    • Responsive design, through the use of relative CSS units;
    • Strong event driven support;
    • Slider content can be overridden or rewritten from scratch;
  • Fast loading. No images used whatsoever;
  • Supports desktop and mobile events.

Installation

You can install from npm:

npm install jquery.rsSliderLens --save

or directly from git:

<script src="http://rawgit.com/ruisoftware/jquery-rsSliderLens/master/src/jquery.rsSliderLens.js"></script>

or you can download the Zip archive from github, clone or fork this repository and include jquery.rsSliderLens.js from your local machine.

You also need to download jQuery. In the example below, jQuery is downloaded from Google cdn.

Usage

First, you must run grunt. Grunt among other tasks, compiles LESS file into CSS, minimizes the js file and places all production files inside a new dist folder.

Create the following file in the src folder (or you can try it live here).

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="../dist/rsSliderLens.css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
    <script src="../dist/jquery.rsSliderLens.min.js"></script>
    <style>
        section {
            margin: 1em 3em;
        }
        p {
            margin-top: 3em;
            color: #eee;
        }
    </style>
</head>
<body>
    <section>
        <p>Ruler slider</p>
        <input type="range">

        <p>Fixed ruler slider ranging from -100 to 100 with a step of 5</p>
        <input type="range" min="-100" max="100" step="5">

        <p>Content slider</p>
        <span>This is the original HTML content</span>
    </section>

    <script>
        $("input[type=range]").eq(0).rsSliderLens();

        $("input[type=range]").eq(1).rsSliderLens({
            paddingStart: .1,
            paddingEnd: .1,
            fixedHandle: true,
            ruler: {
                size: 6 // 600% of the slider width
            }
        });

        $("span").rsSliderLens({
            ruler: {
                visible: false // hide the ruler, show the html content
            }
        });
    </script>
</body>
</html>

License

This project is licensed under the terms of the MIT license

Bug Reports & Feature Requests

Please use the issue tracker to report any bugs or file feature requests.

Contributing

Please refer to the Contribution page from more information.

Comments
  • Bug when pragmatically updating value for single sliders

    Bug when pragmatically updating value for single sliders

    There is a bug in the code when setting the sliders value via JavaScript.

    The problem appears to be on line 662, changing it as below solves the problem. Note the same bug may be on line 513, I have not tested this. Sorry for not creating a pull request I was having trouble doing so.

    •                                panUtil.gotoAnim(info.currValue[0], info.getCurrValue(value), opts.handle.animation, opts.keyboard.easing);
      
    •                                panUtil.gotoAnim(info.currValue[0], info.getCurrValue(value), opts.handle.animation, opts.keyboard.easing, elemHandle.$elem1st);
                                 }
      
    opened by jculloty 8
  • Programatically update ruler values

    Programatically update ruler values

    Jose Rui Santos

    Please, trying to update ruler values array.

    lista = [0,1,2,3,4,5,6,7,8)

    • $(".myClass").rsSliderLens('option','ruler["labels"]["values"]',lista ) => not working
    • $(".myClass").rsSliderLens('option','ruler.labels.values',lista ) => not working
    • $(".myClass").rsSliderLens('option','ruler', {labels: {values:lista}} ) => not working
    • $(".myClass").rsSliderLens('option','ruler.labels', { values: lista }) => not working
    • $(".myClass").rsSliderLens('option','ruler','labels', { values: lista }) => not working
    • $(".myClass").rsSliderLens('option','ruler',{labels: { values: lista }})=> not working
    • $(".myClass").rsSliderLens('option',{ruler: {labels: { values: lista }}})=> not working

    How can i code the rigth way?

    opened by rgvieira 4
  • Changing the sliders range causes it's value to reset

    Changing the sliders range causes it's value to reset

    After updating the range the sliders current value should be used to update the handles. Currently the initial value is being used. This causes the slider to reset whenever the range is changed.

    I think this change should fix the issue

    patch.txt

    opened by jculloty 4
  • Issues with BIG numbers such as UNIX Timestamps

    Issues with BIG numbers such as UNIX Timestamps

    There is an issue when using min and max values exceeding a certain amount of cyphers.

    1. Starting around value 1000000 the dragging becomes unusable, totally slow, "delayed". I assume there are too many steps to "process" when we go by step 1.

    2. While above could however be workarounded, the next related issue is showstopping. Example, min: 10, max:100000000 will throw an error and break the plugin:

    jquery.rsSliderLens.js:1210 Uncaught RangeError: Invalid string length
        at t (jquery.rsSliderLens.js:1210)
        at jquery.rsSliderLens.js:1241
        at Object.renderSvg (jquery.rsSliderLens.js:1250)
        at Object.initSvgOutsideHandle (jquery.rsSliderLens.js:26)
        at Object.initSvgHandle (jquery.rsSliderLens.js:290)
        at Object.init (jquery.rsSliderLens.js:305)
        at new a (jquery.rsSliderLens.js:1715)
        at HTMLInputElement.<anonymous> (jquery.rsSliderLens.js:1857)
        at Function.each (jquery.min.js?ver=3.5.1:2)
        at s.fn.init.each (jquery.min.js?ver=3.5.1:2)
    

    Again, it is obvious we cannot print out one million labels and steps on the slider, but these high numbers are nothing when we work with UNIX Timestamp, for which I intended to use your very nice JS Slider Plugin.

    I want to produce a "Date" Slider where we can select a minimum and maximum date within a range of dates spanning from 1.1.2016 to 1.1.2021 That is already enough to break the plugin as it means to pass timestamp in seconds as so:

    var start = 946684800001;
    var end   = Date.now();`
    

    This breaks the plugin with above error message. Even if we would divide above UNIX to make the number smaller, the amount of cyphers in the string is too much, and the plugin fails.

    Is there any suggestion to create such Date Sliders with your plugin? Perhaps I miss something obvious.

    For reference, this is a sample code to replicate the issue:

    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/test/sliderLens.min.css">
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.rsSliderLens.min.js"></script>
    <input type="range" id="full-custom-range">
    <style>
    body {
        background-color: unset !important;
    }
    </style>
    <script>
    var start = 946684800001;//begin 2016
    var end   = Date.now();//today
    jQuery("#full-custom-range").rsSliderLens({
    	width: 369,
            min: start,
            max: end,
            value: [start, end],
    		step: 2419200,//approximately one month in UNIX
    		paddingStart: 0.1,
            paddingEnd: 0.1
    });
    </script>
    
    opened by smileBeda 2
  • Changing the range fails

    Changing the range fails

    Trying to change the current range properties, $yourPlugin.rsSliderLens('option', 'range', { type: [ -20, 55 ], draggable: true }) does nothing, as a new range does not become visible. After this, any mouse events causes further exceptions to be thrown.

    opened by ruisoftware 1
  • Event destroy does not correctly cleans up all the markup

    Event destroy does not correctly cleans up all the markup

    The call to $slider.rsSliderLens('destroy') leaves out some elements in the page. All the html elements should be completely removed. The page should be restored to the state it was before the plugin was created.

    opened by ruisoftware 0
  • Bug when pragmatically updating value for single sliders

    Bug when pragmatically updating value for single sliders

    The div contains control is hidden, when the show div and I move by the code it will be frozen. $("#sl").rsSliderLens('option', 'value', 10); Error when not focus.

    opened by bvnhan 1
Owner
Jose Rui Santos
Jose Rui Santos
Tenzi is a dice game. The player needs to roll dice until they are all the same. Clicking on a dice, freezes it at its current value between rolls. Best scores are saved to local storage.

Roll until all dice are the same Try me! Technologies Used Description Tenzi is a dice game used to demonstrate the use of React Hooks (useState, useE

Michael Kolesidis 7 Nov 23, 2022
Web based application that uses playerctl in it backend to control remotely your audio using the frontend as remote control.

Linux Remote This is a web based application that uses playerctl in it backend to control remotely your audio using the frontend as remote control. Do

Gabriel Guerra 4 Jul 6, 2022
A three.js and roslibjs powered web-control for zju fast-drone-250 for laptop-free flight control

Web Control for ZJU Fast-Drone-250 A three.js and roslibjs powered web-control for zju fast-drone-250 for laptop-free flight control (tested on Xiaomi

null 6 Nov 11, 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
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

Polar Notion 518 Nov 1, 2022
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
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,

Baidu BEFE 1.7k 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>

Brad Birdsall 6.8k Dec 16, 2022
A lightweight, modern and customizable JavaScript slider library.

NSlider NSlider is a lightweight (< 10 KB), modern and customizable JavaScript slider library. CDN Development https://cdn.jsdelivr.net/gh/fatihege/ns

Fatih 6 Jan 20, 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

Thom 9 May 20, 2022
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.

Tool Cool 23 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.

null 0 Sep 27, 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
Bookmate - Watch changes in Chrome bookmarks, and use bookmarks as an append-only key-value store via an fs-like API.

?? Bookmate An append-only key-value store built on Chrome bookmarks, plus an asychronous stream of Bookmark changes. For NodeJS Actual production exa

Cris 6 Nov 8, 2022
Byteroo - Key-value storage for your Node.js applications

Byteroo Byteroo is a key-value storage for your Node.js applications. Usage: const Byteroo = require('byteroo'); const storage = new Byteroo({ name:

JMax 1 Jan 3, 2022
Resolve parallel promises in key-value pairs whilst maintaining type information

async-kv Resolves promises in key-value pairs maintaining type information. Prerequisites NodeJS 12 or later Installation npm i async-kv yarn add asyn

Tony Tamplin 4 Feb 17, 2022
Sheetzapper imports your account value accross Zapper.fi supported wallets and dapps into a Google Sheet

Overview Sheetzapper imports your account value accross Zapper.fi supported wallets and dapps into a Google Sheet. This allows you to chart your net w

null 4 Nov 27, 2022
It consists of a recreation of Twitter, to put into practice both Front-end and Back-end knowledge by implementing the MERN Stack together with other technologies to add more value to the project.

Twitter-Clone_Back-end ✨ Demo. ?? About the project. ?? Descriptions. It consists of a recreation of Twitter, to put into practice knowledge of both F

Mario Quirós Luna 5 Apr 12, 2022