Closed rogervila closed 8 years ago
Every instance has actually an id="js-rangeslider-{{n}}"
attribute.
// Get a nodelist of all rangeslider.js instances
document.querySelectorAll('[id^="js-rangeslider"]')
To set an additional data attribute you could use the onInit
fn e.g.
$('input[type=range]').rangeslider({
polyfill: false,
onInit: function() {
this.$range[0].setAttribute('your-attribute', 'your-value');
}
});
amazing, this is what I was looking for.
Thank you and congratulations for the plugin!
✨
Hello,
I want to show/hide different sliders with some checkbox that act as a toggle.
Now I'm accessing the
div.rangeslider
by its parent with jQuery, but if I have to change the layout, I will have to rewrite this part of the code.I would like to be able to pass an identifier (maybe a
data
attribute, or an id) to every rangeslider div.is it possible to do this?
Thank you.