EzDevInfo.com

rangeslider.js

HTML5 input range slider element polyfill. — rangeslider.js simple, small and fast html5 input range slider element polyfill

IPhone Range Slider

I know there is a UISlider but does anyone already made RangeSlider ( with two thumbs ?) or knows how to extend the uislider?


Source: (StackOverflow)

How to reset the slider value based on checkbox using JavaScript?

I have a range slier & I am trying to reset it's value to default if a checkbox is clicked. Can anyone tell how to do this?

This is what I tried:

HTML:

<input type="range" id="myRange" max="10000" min="60">
<input type="checkbox" id="lala" onclick="myFunction()"> checkme

JavaScript:

function myFunction()
{
   document.getElementById('myRange').value=60;
}

Fiddle


Source: (StackOverflow)

Advertisements

jQuery range slider with incline plane?

Any ideas on how to style a range slider to do something like this where the highlight fill increases along an incline as you drag the slider (colors/design are example only):

enter image description here


Source: (StackOverflow)

Customizing kendo UI rangeSlider handle

I am trying to use an image for the rangeSlider left and right handle. I noticed that the both of these handles are of anchor element of class k-draghandle and I am adding an child image element to it by dom manipulation.

Is there an easier way to customize the these handles?


Source: (StackOverflow)

How to handle jQuery UISlider change event for range slider

I have a two handle jQuery UI Slider, under each handle of it, there's a number that should change everytime user changes the handles, I can only change one of them.

I need to detect which handle has been moved, and in which direction it has moved, to calculate the numbers.

HTML:

<div id="slider-range"></div>
<div id="amount">
    <span class="minslider"><span class="minprice">0</span> Dollar</span>
    <span class="maxslider"><span class="maxprice">3000000</span> Dollar</span>
</div>

jQuery:

 $(function() {
    $( "#slider-range" ).slider({
        range: true,
        min: 0,
        max: 15,
        values: [ 0, 15 ],
        step: 1,
        change: function( event, ui ) {
            var maxprice = $('.maxprice').text();
            var oneslice = Math.round(maxprice / 15);
            var finalprice = maxprice - oneslice;
            $('.maxprice').text(finalprice);
        }
    })
});

Source: (StackOverflow)

Pure JQuery based range slider which doesn't use jQuery UI

Does anyone know a good, independent jQuery range slider plugin that doesn't rely on jQuery UI?


Source: (StackOverflow)

Binding data to a simple range slider

I need to bind an input field to a slider

<input id="testScore" type="text" min="0" max="100" name="testScore" value="{{testForm.testScore}}" ng-model="testForm.testScore" ng-pattern="onlyNumbers"><span id="unit">%</span>
<input class="progress-slider" type="range" min="0" max="100" ng-model="testForm.testScore">
<div class="inner" ng-style="{ width: selectedRange + '%' || '0%' }"></div>

So when I give text type as "number" I can type the input which changes the slider position, I can even get the range, but when i try to move the slider, the input field value is not shown. Like there is only one way binding.

But when I give type as "text" it is binding two ways, entering value inside the input moves the slider as well as moving the slider changes the input value, but I cannot get it to have a range from 0-100 because it is a text type input.

Is there a way I can solve it with getting two way binding and to have the min and max range defined.


Source: (StackOverflow)

Connect range slider Jquery

I try to connect several range slider from: http://ionden.com/a/plugins/ion.rangeSlider/en.html so that the end of the first slider is automatically recognized as the fix start of the second and so on. Furthermore this should be updated on the fly. My current code works only partially - connection works (even it is not fixed), but the real time update is not working.

Attached the code:

from = 0, 
to = 0;
from2 = 0,
to2 = 0;

var saveResult = function (data) {
    from = data.from;
    to = data.to;
};

var writeResult = function () {
    var result = from;
    $result.html(result);
};

var saveResult2 = function (data) {
    from2 = data.from;
    to2 = data.to;
};

var writeResult2 = function () {
    var result2 = from2;
    $result.html(result);
};




$("#select-length").ionRangeSlider({
    hide_min_max: true,
    keyboard: true,
    min: 0,
    max: 20,
    from: 0,
    to: 10,
    type: 'double',
    step: 0.25,
    prefix: "",
    grid: true,
    onStart: function (data) {
        saveResult(data);
        writeResult();
    },
    onChange: function(data){
        saveResult(data);
        writeResult();
    },
    onChange: saveResult,
    onFinish: saveResult
});

$("#select-length2").ionRangeSlider({
    hide_min_max: true,
    keyboard: true,
    min: 0,
    max: 20.16,
    from: to,
    to: 12,
    type: 'double',
    step: 0.25,
    prefix: "",
    grid: true,
    onStart: function (data) {
        saveResult2(data);
        writeResult2();
    },
    onChange: function(data){
        saveResult2(data);
        writeResult2();
    },
    onChange: saveResult2,
    onFinish: saveResult2
});

$("#select-length3").ionRangeSlider({
    hide_min_max: true,
    keyboard: true,
    min: from2,
    max: 20.16,
    from: 12,
    to: 12,
    type: 'double',
    step: 0.25,
    prefix: "",
    grid: true
});

Source: (StackOverflow)

Bootstrap Range Slider limit handle range

I replaced the handle of bootstrap slider with a background image of size 39px x 39px.

Now I want to limit the range of my bootstrap slider handle as seen on the second example. However, how do I fix it in a way that the handle does not get out of range of the track?

<div style="width:80%; margin: 50px auto;">     
    <input id="ex1" data-slider-id='rangeslider' type="text" data-slider-min="0" data-slider-max="300" data-slider-step="1" data-slider-value="0"/>
</div>

<div style="width:80%; margin: 50px auto;">     
    <input type="range" step="1" value="0" max="10" min="0" name="Size" id="size">
</div>

Source: (StackOverflow)

Rangeslider highlight background not working good in JQuery Mobile

I'm using a rangeslider with JQuery Mobile 1.4.2 and I want change the highlight background, but I can not make it work correctly.

I've created my themes via Theme Roller, I have two: theme A (image left) and theme B (image right). I want that my rangeslider be like theme B.

rangesliders theme (A-left, B-rigth)

I've tried writting the data-track-theme in the rangeslider but the highlight background disappear:

<div data-role="rangeslider" data-mini="true" data-track-theme="b">
    <label for="range-1a">Rango de números a utilizar (1-100)</label>
    <input type="range" min="1" max="100" value="1" >
    <input type="range" min="1" max="100" value="30">
</div>

And looks like this:

no highlight background

I've tried to change the highlight background with CSS too:

.ui-slider-track{
  background: #FFCC99!important;
}
.ui-slider .ui-btn-active{
  background: #FF8000!important;
}
.ui-rangeslider .ui-btn-active{
  background: #FF8000!important;
}

And everything seem works good, but when I move the left control the highlight background disappear and when I move the right control the highlight background appears again.

correct rangeslider highlight background

Any idea how solve it? Thanks!


Source: (StackOverflow)

jQuery nstSlider right-to-left

I am using jQuery nstSlider (http://lokku.github.io/jquery-nstslider/) for a direction - rtl page. I could not find any support for rtl in their documentation.


Source: (StackOverflow)

noUiSlider: Adjusting rounded input values

When I enter a non-rounded number into the #annual-sales input field, the plugin automatically rounds it up or down, depending on "upper" or "lower". Is there a way for me to enter a specific number into the field such as 1234567 and have it retain that value? Then sliding to the previous or next value would snap it back into place.

<input type="text" id="annual-sales">
<div class="slider-wrap">
  <div class="range-slider-sales-vol"></div>  
</div>

// The first number in the array represents the range. Between the 4 options below I have a range from 1000 - 1000000.
// The second number represents the stepped increments within the given range. From the first to second range the stepped increments are 1000.

var range_all_sliders = {
    'min': [ 1000, 1000 ],
    '33%': [ 100000,  50000 ],
    '66%': [ 500000, 100000 ],
    'max': [ 1000000 ]
};

$('.range-slider-sales-vol').noUiSlider({
    start: [ 1000 ],
    range: range_all_sliders,
    format: wNumb({
        decimals: 0
    })   
});

// Pips plugin for points along range slider
$('.range-slider-sales-vol').noUiSlider_pips({
    mode: 'positions',
    values: [0,33,66,100],
    density: 4,
    stepped: true
});

// links range slider to input
$('.range-slider-sales-vol').Link("lower").to($('#annual-sales'));

Source: (StackOverflow)

Filtering ui-grid[ng-grid 3.0/or earlier] using range slider

I want to filter a standard ui-grid [ng-Grid 3.0] with range sliders. In the tutorial section I found the from to interval text input filters, but I cannot bind it to angularjs values coming from range sliders. Any ideas?

Alternatively I would (once again) revert my code to ng-Grid < 3.0. Any ideas how to do that here (I got to the point where I can filter multiple columns at once depending on the filteroptions.filtertext.

Thanks in advance


Source: (StackOverflow)

JavaFX ControlsFX CSS for RangeSlider

I have just downloaded the JavaFX ControlsFX library and am currently stuck. I'm using one of the custom components in the library, called a RangeSlider, but need to manipulate style for each thumb in CSS. I've looked all over the place but can't seem to find anything useful. Is there a way to do that? I know with regular java Slider components, this can be done:

.slider .thumb {
     // Style code here
 }

But when I use something like this for RangeSlider, nothing works. It makes sense because there's 2 sliders, but I've tried 100 combinations for what the substructure names would be to no avail.

Mission: I'm trying to change each thumbs icon and I'm also interested in changing the color that is drawn in between the 2 thumbs(currently blue).

Hopefully this is something wildly obvious, thank you!


Source: (StackOverflow)

step size change

I am using the excellent rangeslider.js by Andre Ruffert

I have one question. I have the slider set up so my numbers increase in increments of 6 as I move the slider along like so: 6,12,18,24,30,36,42,48,54,60

However I want the slider to increase by increments of 12 when it reaches 36 thus skipping out '42' and '54' so that when I move the slider it can be pulled along to the following: 6,12,18,24,30,36,48,60

is there a way that i can do this in js or html?

This is the code that should set up the slider values but for some reason this doesn't work:

$(function() {
        var valMap = [6, 12, 18, 24, 36, 48, 60];
        $("#term").rangeslider({
            min: 6,
            max: valMap.length - 1,
            value: 24,
            slide: function(event, ui) {                        
                $("#amount").val(valMap[ui.value]);                
            }       
        });

I can't get the JavaScript functions to overwrite the HTML code for the slider which reads like this:

<input type="range" name="term" min="6" max="60" step="6" value="36" data-rangeslider>

Source: (StackOverflow)