lundi 18 juillet 2016

Nouislider change format

i need help with my nouislider on my wordpress site. If the user chose the 'max': 20000 "20.000 €", a function change the format that an plus sign is behind the "20.000 € +".

Can anyone help me to add this function?

var skipSlider = document.getElementById('skipstep');

noUiSlider.create(skipSlider, {
   start: [ 500, 2000 ],
    snap: true,
    connect: true,
    range: {
        'min': 0,
        '10%': 500,
        '20%': 1000,
        '30%': 2000,
        '50%': 5000,
        '70%': 10000,
        'max': 20000
    },
      format: wNumb({
        decimals: 3,
        thousand: '.',
        postfix: ' €',
    }),
      pips: {
        mode: 'range',
        density: 3
    }
});



var lowerValue = document.getElementById('lower-value'),
    upperValue = document.getElementById('upper-value');

skipSlider.noUiSlider.on('update', function( values, handle ) {
      var value = values[handle];


    if ( !handle ) {
        lowerValue.innerHTML = values[handle] + '';
      }

    else { 
        upperValue.innerHTML = values[handle] + '';
    }


});

Aucun commentaire:

Enregistrer un commentaire