$("#storlekslider").slider({
range: "max",
min: 0,
max: 1500,
value: 0,
slide: function(event, ui) {
$("#storlek_testet").val(ui.value);
$(ui.value).val($('#storlek_testet').val());
}
});
// $( "#storlek_testet" ).val( $( "#storlekslider" ).slider( "value" ) );
$("#storlek_testet").change(function() {
$("#storlekslider").slider("value", $(this).val());
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://code.jquery.com/ui/1.9.0/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/ui/1.9.0/themes/base/jquery-ui.css">
<div id="storlekslider"></div>
<input type="text" name="storlek" id="storlek_testet" value="500" />
Heres a js fiddle
im trying to get the slider to jump to the correct position when I change the value in the input field. Iam using the Jquery UI slider.