File: D:/HostingSpaces/SBogers85/dale-int.com/wwwroot/js/parallax.js
/*// PARALLAX -/- FLOATING BLOCK
var distance = $('.about-floating-block').offset().top,
$window = $(window);
$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
$('.about-floating-block').animate({
bottom: $x/12.5 + 'px'
},0);
}
else{
$('.about-floating-block').css({
bottom: '0px'
},0);
}
});*/
// PARALLAX -/- IMAGE BACKGROUND
var distance = $('.image-background').offset().top,
$window = $(window);
$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);
}
});