Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sectionFadeIn() {
- $('.fadein').each(function() {
- var top_of_object = $(this).offset().top + 50;
- var bottom_of_window = $(window).scrollTop() + $(window).height();
- if (bottom_of_window > top_of_object) {
- $(this).animate({ 'opacity': '1'}, 1000);
- }
- })
- .fadein {
- opacity: 0;
- }
- .fadein:first-of-type {
- opacity: 1;
- }
Add Comment
Please, Sign In to add comment