noUiSlider icon indicating copy to clipboard operation
noUiSlider copied to clipboard

Pip feature

Open HerrSammyDE opened this issue 1 year ago • 3 comments

Hey,

is it possible to set some kind of active class on a pip that has just been selected?

Here is an example: chrome_zeOCQQnzFO

HerrSammyDE avatar Jul 30 '22 15:07 HerrSammyDE

Hi!

Not as a build in feature, but you can do this using the event system.

You can do something like this (I'm on mobile so the example isn't complete):

slider.noUiSlider.on('update', function(values, handle) {
    // (remove active class from current active handle)
    // (format value, handle querySelector)
    document.querySelector('.noUi-value[data-value="'+ values[handle] +'"]).classList.add('active');
});

leongersen avatar Jul 30 '22 16:07 leongersen

Thanks! Would you perhaps have a direct example where this works?

HerrSammyDE avatar Jul 30 '22 18:07 HerrSammyDE

Yeah! I've added this (and #1215) as an example to the documentation:

Interacting with pips.

leongersen avatar Aug 01 '22 15:08 leongersen

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Sep 18 '22 00:09 github-actions[bot]