ovidiuch / dragdealer

Drag-based vanilla JS component
http://ovidiuch.github.io/dragdealer
MIT License
1.05k stars 149 forks source link

Set step to start on when initialising #115

Closed dka09 closed 8 years ago

dka09 commented 8 years ago

Is it possible to set the step to start on when initializing dragdealer similar to how you can give an x value?

Using the setStep function after initialising dragdealer allows you to see the bar moving to the position. I want it to be there on load.

EDIT: Or how could I calculate the x value of a certain step and I can just set that?

dka09 commented 8 years ago

I calculate the x value by doing (step - 1) / (totalSteps - 1) and set x.