$().dialog("destroy"); and IDs

$().dialog("destroy"); and IDs


Hi there,
I ran into trouble using the new dialog-functionality. As you will
see, I am using the slider too. That's the code (reduced to minimum):
newHtml = '<div><div id="stackItemSlider" class="ui-slider-1 ui-slider
center">';
newHtml+= '<div class="ui-slider-handle"></div>';
newHtml+= '</div>';
newHtml+= '<div class="center">Fancy Slider: <span id="stackAmount">1</
span> </div></div>';
$(newHtml).dialog({
    open: function () {
        $("#stackItemSlider").slider();
    }
});
After calling $(e).dialog("destroy"); and then the dialog-code pasted
above again, the slider doesn't work. I fount out why: I am quite sure
that the dialog-object is not removed correctly. Using classes instead
of IDs, it works fine. So it is easy for me to use classes instead of
IDs but it would be even better to have this glitch fixed.
Regards,
Eric