Create a Slide in/out dialog in JavaScript
Description
The following code shows how to create a Slide in/out dialog.
Example
<!-- w w w . ja v a2 s. com-->
<html>
<head>
<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" />
<script type='text/javascript'>
$(document).ready(
function() {
$('input#tmpOpen').click(
function($e) {
$('div#tmpDialogue').slideDown(5000);
}
);
$('input#tmpClose').click(
function($e) {
$('div#tmpDialogue').slideUp(5000);
}
);
}
);
</script>
<style type='text/css'>
div#tmpDialogue {
display: none;
position: absolute;
top: 50%;
left: 50%;
width: 500px;
height: 200px;
margin: -100px 0 0 -250px;
background: rgb(233, 233, 233);
border: 1px solid rgb(128, 128, 128);
}
div#tmpButtons {
position: absolute;
bottom: 5px;
right: 5px;
}
</style>
</head>
<body>
<input type='submit' id='tmpOpen' value='Open' />
<div id='tmpDialogue'>
<p>
Dialog content
</p>
<div id='tmpButtons'>
<input type='submit' id='tmpClose' value='Close' />
</div>
</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...
Build jQuery UI Slider - Vertical slider in...
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 JavaScript
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...