I have 3 Sliders in one JQuery Dialog, i want them to have a maximum value, but the maximum is not only for one slider it is for the sum of all of them. My script runs fine in google chrome debuger the only problem is that the value of the slider is not updated in `$(this).slider("value", (sliderMax - sum));` 

```
$(".slider").each(function() {
    var id = $(this).attr("id");
    id = id.replace("Slider", "Value");
    var sliderMax = 27;
    $(this).slider({
        range : "min",
        min : 0,
        max : sliderMax,
        value : $("#" + id).attr("value"),
        slide : function(event, ui) {
            var sum = 0;
            $(".sliderValue").each(function() {
                if ($(this).attr("id") != id) {
                    sum += parseInt($(this).attr("value"));
                }
            });
            if ((sum + $(this).slider("value")) > sliderMax){
                $(this).slider("value", (sliderMax - sum));
            }
            $("#" + id).val(ui.value);
        }
    });
});

```

pls help me.