jQuery slideToggle function

It is sample code for using jQuery slideToggle() function
<!DOCTYPE html>
<html>
<head>
	<meta name="viewport" content="width=device-width,user-scalable=no"/>
    <script type="text/javascript" src="./js/jquery-1.9.1.js"></script> 
    <style type="text/css"> 
		div.slide,.flip
		{
			margin:0px;
			padding:5px;
			text-align:center;
			background:red;
			
		}
		div.slide
		{
			height:120px;
			display:none;
		}
	</style>  
</head>
<body>
	<div class="slide">
		<p>This is slideToggle test</p>
		<p>show the detail info</p>
	</div>
	<button class="flip">click</button>

<script>
	$(document).ready(function(){
		$(".flip").click(function(){
	    	$(".slide").slideToggle("fast");
		});
	});
</script>
</body>
</html>

Responses

0 Replies