This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
oktoberfest-2014/js/oktoberfest.js
T

22 lines
572 B
JavaScript

function scrollTo(ev, element, highlight) {
if (highlight === undefined) highlight = false;
var initialColor = "#95AA61";
if (highlight) $(element).css("background", initialColor);
$("body").stop().scrollTo(element, 400, function() {
if (highlight) $(element).animate({ backgroundColor: $.Color('transparent') }, "slow");
});
ev.preventDefault();
}
/**
* Parallax.
*/
$(function() {
$(document).scroll(function() {
$('body').css( 'background-position', '0px -' + $('body').scrollTop()/20 + 'px' );
console.log( $('body').scrollTop()/2 + ' 0px');
});
});