Slide toggle in 1 second - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:slideToggle

Description

Slide toggle in 1 second

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("button").click(function(){
        $("p").slideToggle(1000);
    });/*from w ww  .j av a2s  . c o m*/
});
</script>
</head>
<body>

<p>This is a paragraph.</p>

<button>Toggle slideUp() and slideDown()</button>

</body>
</html>

Related Tutorials