Rectangle 27 0

php Problem with jQuery slider time?


<script> 
    $(function() {
        var select = $( "#czastrwania" );
        var slider = $( "<div id='slider'></div>" ).insertAfter( select ).slider({
        min: 60,
        max: 240,
        step: 30,
        range: "min",
value: select[ 0 ].selectedIndex + 1,
            slide: function( e, ui ) {
            var hours = Math.floor(ui.value / 60);
            var minutes = ui.value - (hours * 60);

            if(minutes == 0) minutes = '00';
            select[ 0 ].value = hours+':'+minutes;
            }
        });
        $( "#czastrwania" ).change(function() {
            slider.slider( "value", select[ 0 ].value );
        });
    });
    </script>

Now it's working for 50%. If i change on slider it changes on select, but it doesn't work when i change values on select.

Note