fade in and fade out in jquery code example

Example 1: on click fade out jquery

$(document).ready(function(){
  $("button").click(function(){
    $("p").fadeOut(2500);
  });
});

Example 2: jquery fadein

$(".example").fadeIn(500);

Example 3: fadein fadeout jquery

$('.btn-cart').click(function(e) {
		e.preventDefault();
		$('.cartlist').fadeIn().addClass('active');
	});

	$('.btn-cartlist-close').click(function() {
		$('.cartlist').removeClass('active').fadeOut();
	});

Example 4: jquery fade out

$(selector).fadeOut(duration)
$(selector).fadeIn(duration)

Example 5: jquery fadein display new page

$(document).ready(function(){

/*! Fades in page on load */
$('body').css('display', 'none');
$('body').fadeIn(500);

});