I have the following code that implements 2 jQuery sliders :
<script type="text/javascript"> $(document).ready(function () { $("#wheelLeft").slider({ value: 50, min: -100, max: 100, slide: handleSlide }); $("#wheelRight").slider({ value: -10, min: -100, max: 100, slide: handleSlide }); }); function handleSlide(event, ui) { $("#lblInfo").text(ui.id + ':' + ui.value); } </script>
As you can see, both sliders generate a slide event, which is processed by the handleSlide function. Inside the handleSlide function handleSlide I can get the value of the slider by calling ui.value, but how do I know which slider actually created the event?
I tried ui.id, ui.name and some others that seemed logical, but they all returned as undefined. How to get the actual name of its CSS implementation (e.g. #wheelRight or #wheelLeft)?
Thanks.
source share