I have an interesting(for me) issue I couldn't figure out. The code performs as I expect it to, setting the slider initial position depending on value of "current_value" variable, but only if I don't set the SVG Viewbox with Snap, on document ready.
On the Code pen, you can remove that part at the beginning of $(document).ready and the slider sets the initial position correct.
If the ViewBox is set, then the slider sets itself on some weird position I couldn't figure out. Mostly it goes out of bounds on the right, depending on the screen size. Try to view same code pen full screen. -> this
I'm sorry if the codepen is messy, I tried clearing it out as much as I could.
It is imperative for me to have the viewbox set, for resizing and centering the whole SVG. I feel like I need to tell Greensock that the view box has changed with Snap or something like that.
Help? What did I miss?
One below is working as expected, only this was removed on load
var svg = Snap('#svg');
viewBox: "0 0 1280 720",
//////////remove to here
This one setting the initial position of the slider wrong: