Jquery one slider controls another

How to make one jquery ui slider different? If I move slider # 1, it should also move slider # 2.

+2
source share
1 answer

Put the slide / change function when creating a slider that uses the value ui.value of the descriptor to be changed on the slider and sets the value of the descriptor on the slider2. Depending on how many descriptors of your sliders you need to configure:

Note I have not tried this, so you may need to configure it.

<div id='example1' class='ui-slider-1' style="margin:10px;">
<div class='ui-slider-handle'></div>    
</div>

<div id='example2' class='ui-slider-1' style="margin:10px;">
<div class='ui-slider-handle'></div>    
</div>

$('#example1').slider( { slide: moveSlider2 } );
$('#example2').slider( );

function moveSlider2( e, ui ) 
{
    $('#example2').slider( 'moveTo', ui.value );
}
+1
source

Source: https://habr.com/ru/post/1699633/


All Articles