Build jQuery UI Slider - Vertical slider in JavaScript
Description
The following code shows how to build jQuery UI Slider - Vertical slider.
Example
<!-- Revised from demo code on http://jqueryui.com/ -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Slider - Vertical slider</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" rel="stylesheet" />
<!--from w ww. j av a2s. c o m-->
<script>
$(function() {
$( "#slider-vertical" ).slider({
orientation: "vertical",
range: "min",
min: 0,
max: 100,
value: 60,
slide: function( event, ui ) {
$( "#amount" ).val( ui.value );
}
});
$( "#amount" ).val( $( "#slider-vertical" ).slider( "value" ) );
});
</script>
</head>
<body>
<p>
<label for="amount">Volume:</label>
<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;" />
</p>
<div id="slider-vertical" style="height:200px;"></div>
<div class="demo-description">
<p>Change the orientation of the slider to vertical. Assign a height value via <code>.height()</code> or by setting the height through CSS, and set the <code>orientation</code> option to "vertical."</p>
</div>
</body>
</html>
The code above generates the following result.
Javascript Tutorial Slider
Build jQuery UI Slider - Colorpicker in Jav...
Build jQuery UI Slider - Default functional...
Build jQuery UI Slider - Multiple sliders i...
Build jQuery UI Slider - Range slider in Ja...
Build jQuery UI Slider - Range with fixed m...
Build jQuery UI Slider - Range with fixed m...
Build jQuery UI Slider - Slider bound to se...
Build jQuery UI Slider - Slider scrollbar i...
Build jQuery UI Slider - Snap to increments...
Build jQuery UI Slider - Vertical range sli...
Handle Slider events: change, slide, start,...
Set step value for slider in JavaScript
Set the max value for slider in JavaScript
Share Three sliders for event handler in Ja...
Build jQuery UI Slider - Colorpicker in Jav...
Build jQuery UI Slider - Default functional...
Build jQuery UI Slider - Multiple sliders i...
Build jQuery UI Slider - Range slider in Ja...
Build jQuery UI Slider - Range with fixed m...
Build jQuery UI Slider - Range with fixed m...
Build jQuery UI Slider - Slider bound to se...
Build jQuery UI Slider - Slider scrollbar i...
Build jQuery UI Slider - Snap to increments...
Build jQuery UI Slider - Vertical range sli...
Build jQuery UI Slider - Vertical slider in...
Create a Slide in/out dialog in JavaScriptHandle Slider events: change, slide, start,...
Set step value for slider in JavaScript
Set the max value for slider in JavaScript
Share Three sliders for event handler in Ja...