jquery - slideup and down one click - sample

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $("button").click(function(){
        $("#p1").slideUp(500).slideDown(500);
        $("#p1").css("color", "red").slideUp(2000).slideDown(2000);
        $("#p1").slideUp(250).slideDown(250);
    });
});
</script>
</head>
<body>

<p id="p1">jQuery is fun!!</p>

<button>Click me</button>

</body>
</html>

Yorumlar