How to achieve an effect where an item fades in when it comes into view and fades out when it goes out of view?
Advertisements Fade-in effect for a button when the user scrolls down and button comes into view and a fade-out effect when the user continue scrolls down and button goes out of view. var scrollButton = $(‘#scrollButton’); scrollButton.css(‘opacity’, ‘0’); $(window).scroll(function() { var scrollPos = $(this).scrollTop(); if (scrollPos > 100) { scrollButton.css(‘opacity’, ‘1’); } else { scrollButton.css(‘opacity’,… Read More How to achieve an effect where an item fades in when it comes into view and fades out when it goes out of view?