Z
Z
Zombie426792017-08-16 20:13:51
css
Zombie42679, 2017-08-16 20:13:51

Can jQuery slider be improved?

There is a standard slider (slider) on jQuery, in the example below the number is displayed by itself, but is it possible to add some property so that the slider also moves if you enter a number from the keyboard into the input with the output of the number, and not move the slider with the mouse? C JavaScript and jQuery problems :(

https://jqueryui.com/slider/#rangemax

Here is my code:

$(function() {
        $("#slr").slider({
            range: "max",
            min: 1,
            max: 10,
            value: 2,
            slide: function(event, ui) {
                $("#lbl").val(ui.value);
            }
        });
        $("#lbl").val($("#slr").slider("value"));
    });

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
cssfish, 2017-08-17
@Zombie42679

article - www.xiper.net/collect/js-plugins/ui/jquery-ui-slider
example - www.xiper.net/examples/js-plugins/ui/ui-slider

S
Stalker_RED, 2017-08-16
@Stalker_RED

It's possible, he has everything in the documentation.
api.jqueryui.com/slider/#method-value
Example: jsfiddle.net/xta14ey4
see last three lines.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question