How to use Effect SlideToggle() Method in JQuery

In this article I am going to explain about Effect SlideToggle() method in jquery.
  • 1901

jQuery Effect SlideToggle() Method

jQuery SlideToggle() Method is also use for sliding purpose and toggle between SlideUp() and SlideDown() for selected element. Its check visible and hide of selected element. If selected element is hidden then run SlideDown() and If Selected element is visible then run SlideUp().

Syntax

$(selector).slideToggle()

Example

<html>

<head>

    <script type="text/javascript" src="jquery.js"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            $("button").click(function () {

                $("div").slideToggle();

            });

        });

    </script>

</head>

<body>

    <div style="background-color: Blue; height: 75px; width: 200px;">

    </div>

    <button>

        Click me</button>

</body>

</html>

Output

toggle.jpg

You may also want to read these related articles: here
 
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 
© 2020 DotNetHeaven. All rights reserved.