JavaScript noUiSlider get Id of slide event caller nouislider slide event

I am having trouble with noUislider, in that I need to be able to differentiate between different sliders when slide events are triggered.

I thought (and from reading the noUiSlider GitHub) that I'd be able to use the 'this' reference, but it doesn't seem to work.

My code:

var mix_slider = document.getElementsByClassName('slider');

for (var i = 0; i < mix_slider.length; i++) 
{
noUiSlider.create(mix_slider[i], {
  start: [100],
  connect: "lower",
  orientation: "vertical",
  direction: "rtl",
  range: {
    'min': 0,
    'max': 127
  }
});

mix_slider[i].noUiSlider.on('slide', function(values, handle){
  var id = this.id; //<-- Needs to be the id of the slider that triggered the slide event 
  var part = id.slice(-2);
  var val = this.noUiSlider.get();//<-- This doesn't seem to work either
  document.getElementById('input_' + part).value = val;
});
};

I'm unsure what I'm doing wrong... I had (on the previous noUiSlider version) used jQuery's $(this).attr('id'); to grab the id, but this does not work either.

Any help would be greatly appreciated

Answer:1

I have this array and I want to count total numbers into this, can anyone please let me know how can i achieve this using pure javascript var total = { "numbers":{ "1":"9897877884", ...

I have this array and I want to count total numbers into this, can anyone please let me know how can i achieve this using pure javascript var total = { "numbers":{ "1":"9897877884", ...

  1. count length array php
  2. count length array javascript
  3. count length array python
  4. count length array jquery
  5. count length array
  6. count length array java
  7. count length array vba
  8. count length array angularjs
  9. count array length in c#
  10. count array length js
  11. count array length mongodb
  12. count array length online
  13. count array length in angular 4
  14. count array length in typescript
  15. count array length bash
  16. count array length powershell
  17. count array length in twig
  18. count array length in angular 6
  19. count length of array in react
  20. laravel count array length

I have successfully uploaded files to Firebase's storage via Google Cloud Storage through JS! What I noticed is that unlike files uploaded directly, the files uploaded through Google Cloud only have a ...

I have successfully uploaded files to Firebase's storage via Google Cloud Storage through JS! What I noticed is that unlike files uploaded directly, the files uploaded through Google Cloud only have a ...

I have just started a school assignment where they want me to detect and recognize objects in a webcam stream, in an webgl application. It will be added to an already existing javascript plugin. It is ...

I have just started a school assignment where they want me to detect and recognize objects in a webcam stream, in an webgl application. It will be added to an already existing javascript plugin. It is ...

  1. real time motion capture
  2. real time motion tracking
  3. real time motion planning
  4. real time motion capture blender
  5. real time motion capture unity
  6. real time motion capture animation
  7. real time motion detection
  8. real time motion graphics
  9. real time motion capture software
  10. real time motion detection matlab code
  11. real time motion detection opencv
  12. real-time motion planning for agile autonomous vehicles
  13. real time motion blur
  14. real time motion studios
  15. real time motion control
  16. real time motion graphics software
  17. real-time motion planning with dynamic obstacles
  18. real time motion interpolation
  19. real time motion
  20. real-time motion tracking from a mobile robot

I have the following table header: <table id="time" class="new_table" border="0" cellpadding="2"> <thead> <tr> <th scope="col" rowspan="2" class="sortHead"...

I have the following table header: <table id="time" class="new_table" border="0" cellpadding="2"> <thead> <tr> <th scope="col" rowspan="2" class="sortHead"...

  1. remove image tags
  2. docker remove image tags
  3. javascript remove image tags from string
  4. php remove image tags
  5. c# remove image tags
  6. pdf remove image tags
  7. python html remove image tags
  8. remove all tags image
  9. docker remove image all tags