freqdec/fd-slider — Issue #12: Rendering error when dynamically adding sliders
Author: dhm116
Created: 2011-12-06 21:02:57+00:00
State: open

If I dynamically add a slider to the page, it does not seem to render correctly unless I switch to a different browser tab. Perhaps I'm doing something terribly wrong.

Coffeescript for adding a slider to an existing input of given name:

```coffeescript

createSlider = (name) ->
fdSlider.createSlider({
inp:document.getElementById(name)
step:1
maxStep:1
min:0
max:100
animation:'tween'
forceValue:true
callbacks: {
"change":[updateValue]
"create":[sliderCreated]
}
})
```

The input the slider is being created for is also being dynamically added via a jQuery template, so that may be convoluting things.

Again, if I simply switch to another browser tab and back, it works fine, so that would lead me to believe there's some issue with how it's being (re)drawn. Is there a way to manually call redraw() on the slider within the create event?