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);
// }
// });