jQuery slideDown() Method - CodingTag
×


jQuery slideDown()

0 824


Related Topics:

jQuery fadeToggle
jQuery fadeTo

jQuery slideDown

Syntax:

$(selector).slideDown(speed,callback);

Parameter description:

  • speed: This parameter used to set the duration of the effect. It can be "slow", "fast" or any time in milliseconds. It is optional.
  • callback: This represents a function which to be executed after the completion of slideDown() method. It is optional.

Example:

<html>
<head>
<title> jQuery Example </title>
<script type = "text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
</script>
<style>
.para1{
background:red;
padding:20px;
cursor:pointer;
}
.para2{
background:yellow;
padding:40px;
display:none;
}
</style>
<script>
$(document).ready(function(){
$(".para1").click(function(){
$(".para2").slideDown();
});
});
</script>
</head>
<body>

<h2> jQuery slideDown() method Example </h2>
<p class="para1"> Click here to slide Down Panel. </p>
<p class="para2"> This is Panel. </p>
</body>
</html>

Output:

When you click,



Best WordPress Hosting


Share:


Leave a Reply


Comments
    Waiting for your comments