# Trigger Slider event

**URL:** <https://community.plotly.com/t/trigger-slider-event/42840>\
**Category:** plotly.js\
**Created:** [July 23, 2020, 8:55am UTC](https://community.plotly.com/t/trigger-slider-event/42840 "2020-07-23T08:55:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![khanrizwan.net](https://avatars.discourse-cdn.com/v4/letter/k/7ea924/32.png) [@khanrizwan.net](https://community.plotly.com/u/khanrizwan.net)\
**Post date:** [July 23, 2020, 8:55am UTC](https://community.plotly.com/t/trigger-slider-event/42840/1 "2020-07-23T08:55:42Z")

</div>

I am using the [basic slider example](https://plotly.com/javascript/sliders/) to show my scatterplots with time slider.  
Is there a way to capture the events on slider change ? I would like to call my APIs and do some other operations (not related to plotly chart).  
Have seen [solutions](https://community.plotly.com/t/animate-clock-slider-for-time-series-chart/18547) adding new trace, but my problem is much simpler that I need to call my function on slider change event.

Regards,  
Rizwan

---

<div class="post-metadata">

**Author:** ![EmanH](https://avatars.discourse-cdn.com/v4/letter/e/76d3ee/32.png) [@EmanH](https://community.plotly.com/u/EmanH)\
**Post date:** [February 11, 2021, 3:04pm UTC](https://community.plotly.com/t/trigger-slider-event/42840/2 "2021-02-11T15:04:16Z")

</div>

You can try something as follows:

Plotly.newPlot(plottingDiv, dataToPlot, plottingLayout)  
plottingDiv.on(‘plotly\_sliderchange’, function (e) {  
var stepLabel = e.step.label  
// do other things needed  
}  
)
