question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2 working independent fields ?

See original GitHub issue

Do not tell me how to do it? I tried to do it like this, but in the end, one field controls both values

var $range = $(".js-range-slider"),
    $input = $(".js-input"),
    instance,
    min = 0,
    max = 4000;

$range.ionRangeSlider({
    type: "single",
    min: min,
    max: max,
    from: 0,
    onStart: function (data) {
        $input.prop("value", data.from);
    },
    onChange: function (data) {
        $input.prop("value", data.from);
    }
});

instance = $range.data("ionRangeSlider");

$input.on("change keyup", function () {
    var val = $(this).prop("value");
    
    // validate
    if (val < min) {
        val = min;
    } else if (val > max) {
        val = max;
    }
    
    instance.update({
        from: val
    });
});

var $range = $(".js-range-slider-to"),
    $inputTo = $(".js-input-to"),
    instance,
    min = 0,
    max = 2000;

$range.ionRangeSlider({
    type: "single",
    min: min,
    max: max,
    from: 0,
    onStart: function (data) {
        $inputTo.prop("value", data.from);
    },
    onChange: function (data) {
        $inputTo.prop("value", data.from);
    }
});

instance = $range.data("ionRangeSlider");

$inputTo.on("change keyup", function () {
    var val = $(this).prop("value");
    
    // validate
    if (val < min) {
        val = min;
    } else if (val > max) {
        val = max;
    }
    
    instance.update({
        from: val
    });
});

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
st1msetcommented, Mar 10, 2018

how it’s complicated) thanks, work)

0reactions
IonDencommented, Mar 9, 2018

@st1mset, no. This is for both, you again rewriting vars. You should have different max and min: min_1, max_1, min_2, max_2

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved For static (time independent) fields, which of the - Chegg
For static (time independent) fields, which of the following current densities are possible? a) J = 2x 3 yax + 4x2z2ay - 6x2yzaz....
Read more >
Conservative Fields & Path Independence (Vector Fields)
A few examples are worked to demonstrate these new line integral shortcuts! 0:00 Gradient/Conservative/Path Independent 2 :10 Fundamental ...
Read more >
As an Independent Contractor, Can I Work for More Than One ...
Independent contractors (IC) are those workers who are self-employed. ICs are taxed differently by the IRS and are generally classified differently than.
Read more >
For static (time-independent) fields, which of the following
An idealized velocity field is given by the formula V = 4txi - 2t²yj + 4xzk Is this flow field steady or unsteady?...
Read more >
Working at Independent Field Connections: 6 Reviews - Indeed
Reviews from Independent Field Connections employees about Independent Field Connections culture, salaries, benefits, work-life balance, management, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found