# Rangeslider triggered and get range

**URL:** <https://community.plotly.com/t/rangeslider-triggered-and-get-range/14540>\
**Category:** plotly.js\
**Created:** [October 15, 2018, 2:27am UTC](https://community.plotly.com/t/rangeslider-triggered-and-get-range/14540 "2018-10-15T02:27:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhaolian](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/zhaolian/32/4393_2.png) [@zhaolian](https://community.plotly.com/u/zhaolian)\
**Post date:** [October 15, 2018, 2:27am UTC](https://community.plotly.com/t/rangeslider-triggered-and-get-range/14540/1 "2018-10-15T02:27:19Z")

</div>

Hi there,

Is there any way I can know when rangeslider is changed and get the selected range of slider or run some function after slider changed?

Code Examples: [https://codepen.io/zhaolian-zhou/pen/qJjJRQ](https://codepen.io/zhaolian-zhou/pen/qJjJRQ).  
In this example, I want to run some function using the updated x axes range after I change the range slider.

Thanks very much.

---

<div class="post-metadata">

**Author:** ![etienne](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/etienne/32/17_2.png) [@etienne](https://community.plotly.com/u/etienne)\
**Post date:** [October 25, 2018, 3:54pm UTC](https://community.plotly.com/t/rangeslider-triggered-and-get-range/14540/2 "2018-10-25T15:54:40Z")

</div>

Listening to `plotly_relayout` should do the trick though this bug [https://github.com/plotly/plotly.js/issues/2216](https://github.com/plotly/plotly.js/issues/2216) might make it a little tricky.

---

<div class="post-metadata">

**Author:** ![zhaolian](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/zhaolian/32/4393_2.png) [@zhaolian](https://community.plotly.com/u/zhaolian)\
**Post date:** [October 25, 2018, 10:29pm UTC](https://community.plotly.com/t/rangeslider-triggered-and-get-range/14540/3 "2018-10-25T22:29:17Z")

</div>

Thanks very much etienne.

I did it by listening to `mouseenter` and `mouseover` events of `rangeslider` class, and get the `xaxis.range` information from `chart.layout`. Kind of tricky.

Will try your solution.
