Closed luopio closed 8 years ago
@luopio this should work in your case:
// Adding the EventListener to the `document`.
// Event delegation helps us to call `rangeSliderStart` only
// if `e.currentTarget` is `.rangeslider`
$(document).on('mousedown touchstart', '.rangeslider', rangeSliderStart);
If you would really touch, mousedown the $('input[type="range"]')
element it'll work but it's actually visually hidden :)
Ah I see. Thanks for the quick answer.
I'm using rangeslider.js in a scenario where I need to fire an event when sliding begins. I figured I'd do this with
but rangeslider captures the mousedown and won't let it bubble up so
rangeSliderStart
is never called. If I changepolyfill
totrue
and use the native widget on Chrome it works as planned.