Slider element id or data attribute
jpaulo1987 opened this issue · 2 comments
jpaulo1987 commented
Question: is there a way to dynamically find out the id or data-attribute of a slider that triggered an 'onChange' event (inside the onChange function)?
I can not use the "sliderId' option because i have multiple sliders on the same page that share the same options object (since the options for all of them are the same, except for the id).
ValentinH commented
The only way is to use the sliderId
. You can definitely share the options between the sliders and just set the id for each of them by creating a new object like:
{...options, id: '123'}
or with Object.assign()
.
ValentinH commented
Closing as there was no answer for a while. Comment to re-open 😉