HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers85/dale-int.com/wwwroot/js/animations.js
/**
 * Created by driesjanssen on 1/12/17.
 */

$('.animation-fade').css('opacity','0');

var distance = $('.animation-fade').offset().top + 150,
    $window = $(window);

$window.scroll(function() {
    if ($window.scrollTop() + $(window).height() >= distance) {
        // If animation element is part in the viewport

        $('.animation-fade').animate({
            opacity: 1,
            complete: function () {
                $(this).removeClass('animation-fade');
            }
        }, 1000);
    }
});


// $window.scroll(function() {
//     if ( $window.scrollTop() + $(window).height() >= distance && $(window).width() >= 900 ) {
//         // If the floating box hits the bottom of the viewport
//
//         // current window scrollTop position
//         $x = $window.scrollTop()
//
//         // Animate the block vertically when scrolling the page
//         $('.image-background').animate({
//             'background-position-x': -$x/4.5 + 'px'
//         },0);
//     }
//     else{
//         $('.image-background').animate({
//             'background-position-x': 0 + 'px'
//         },0);
//     }
// });