what the role of slideDown method in JQuery?

0 votes
46 views
Ethan Karla asked 28-Jul-2021 in Web Application by Ethan Karla

what the role of slideDown method in JQuery?

1 Answer

1 votes
Ravi Vishwakarma answered 29-Jul-2021 by Ravi Vishwakarma

jQuery slideDown() Method

If an element is to be viewed in slide down order, we do it using slideDown method of jQuery.Syntax:

Syntax

 $(selector).slideDown(speed)
 $(selector).slideDown(speed,callback)
Speed and callback is an optional parameter. Speed specifies the delay of showing elements these possible vales are 'slow', 'fast' and milliseconds. Callback function to be called after completion of slideDown()
<!DOCTYPE html>

<html>
<head>
    <script src='https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js'></script>
    <script>
        $(document).ready(function () {
            $('#flip').click(function () {
                $('#panel').slideDown('slow');
            });
        });
    </script>
    <style>
        #flip {
            padding: 10px;
            text-align: center;
            background-color:red;
            background-color: #e5eecc;
            border: solid 1px green;
        }
        #panel {
            padding: 50px;
            text-align: center;
            background-color:yellow;
            background-color: #e5eecc;
            border: solid 1px green;
            display:none;
        }
    </style>
</head>
<body>
    <div id='flip'>Click to slide up and down panel</div>
    <div id='panel'>This is slide up panel </div>
</body>
</html>

what the role of slideDown method in JQuery?