Call function after fadeIn effect - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:fadeIn

Description

Call function after fadeIn effect

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(){
    $(".btn1").click(function(){
        $("p").fadeOut(1000, function(){
            console.log("fadeOut() method is finished!");
        });//from  w  w  w .  j ava 2 s  .  c  o  m
    });
    $(".btn2").click(function(){
        $("p").fadeIn(1000, function(){
            console.log("fadeIn() method is finished!");
        });
    });
});
</script>
</head>
<body>

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

<button class="btn1">Fade out</button>
<button class="btn2">Fade in</button>

</body>
</html>

Related Tutorials