Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

jQuery fadein - fadeout

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("#fadeOut").click(function(){
    $("#div1").fadeOut();
    $("#div2").fadeOut("slow");
    $("#div3").fadeOut(3000);
  });
  
  $("#fadeIn").click(function(){
    //$("#div1").fadeIn();
    //$("#div2").fadeIn("slow");
    //$("#div3").fadeIn(3000);
    
    $("#div1").fadeIn("slow");
    $("#div2").fadeIn("slow");
    $("#div3").fadeIn("slow");
  });

});
</script>
</head>
<body>

<p>Demonstrate fadeIn() / fadeOut() with different parameters.</p>

<button id=fadeIn>Click to fade in boxes</button><br><br>
<button id=fadeOut>Click to fade out boxes</button><br><br>

<!-- display:none는 최초 html로딩시 화면 출력X -->
<div id="div1" style="width:80px;height:80px;display:none;background-color:red;"></div><br>
<div id="div2" style="width:80px;height:80px;display:none;background-color:green;"></div><br>
<div id="div3" style="width:80px;height:80px;display:none;background-color:blue;"></div>

</body>
</html>

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.