jQuery fadeIn() method is used to fade in the element so The fadeIn() method gradually changes the opacity, for selected elements, from hidden to visible (fading effect). Hidden elements will not be displayed at all (no longer affects the layout of the page).
Syntax:
|
$(selector).fadeIn(speed,easing,callback)
|
Example:
|
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".btn111").click(function(){
$("p").fadeOut()
});
$(".btn222").click(function(){
$("p").fadeIn();
});
});
</script>
</head>
<body>
<p>This is a paragraph. hi friends . how are you ?</p>
<button class="btn111">click me to Fade out</button>
<button class="btn222">click me to Fade in</button>
</body>
</html>
|