Puoi partire da questo suggerimento e sviluppare la logica. Un consiglio, sia qui o posti come stackoverflow dovresti precisare se stati usando custom libraries come noUISlider....
var slider = document.getElementById('slider');
var slider1 = document.getElementById('slider1');
var slider2 = document.getElementById('slider2');
var somma = document.getElementById("valore");
noUiSlider.create(slider,{
start: 60,
connect: "lower",
range:
{
'min':0,
'max':100
},
step:5,
tooltips: wNumb({decimals: 0}),
pips: {
mode: 'steps',
density: 3,
}
})
noUiSlider.create(slider1,{
start: 30,
connect: "lower",
range:
{
'min':0,
'max':100
},
step:5,
tooltips: wNumb({decimals: 0}),
pips: {
mode: 'steps',
density: 3,
}
})
noUiSlider.create(slider2,{
start: 10,
connect: "lower",
range:
{
'min':0,
'max':100
},
step:5,
tooltips: wNumb({decimals: 0}),
pips: {
mode: 'steps',
density: 3,
}
})
slider.noUiSlider.on('end', function () {
//slider.noUiSlider.get())
var currValue = parseInt(somma.textContent);
currValue += parseInt(slider.noUiSlider.get());
somma.textContent = currValue;
console.log("current sum: "+currValue);
});