I need to override a slider's default value (HTML "value" attribute) with a value coming from the localStorage.
A simple solution would be to call simpleSlider("setValue", val) in a "ready" event handler.
However, the "ready" event is fired when the SimpleSlider javascript object is ready, but before it's actually connected to the corresponding jQuery node. So the simpleSlider("setValue", val) on the jQuery node fails because it needs access to the SimpleSlider object.
2 possible turnarounds:
call the simpleSlider("setValue", val) in a setTimeout(func, 0) to let the connection be effective
override the HTML attribute before loading simpleSlider.js
I need to override a slider's default value (HTML "value" attribute) with a value coming from the localStorage. A simple solution would be to call simpleSlider("setValue", val) in a "ready" event handler. However, the "ready" event is fired when the SimpleSlider javascript object is ready, but before it's actually connected to the corresponding jQuery node. So the simpleSlider("setValue", val) on the jQuery node fails because it needs access to the SimpleSlider object.
2 possible turnarounds: