parallax header

This commit is contained in:
Alexander Yakovlev 2013-11-04 19:06:43 +07:00
parent 462ae8d0d4
commit d12144822b
2 changed files with 6 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 173 KiB

View file

@ -26,6 +26,12 @@ function scroll_effect() {
// Get the scroll position of the page
scrollPos = jQuery(this).scrollTop();
// Fade out the banner text
if (scrollPos < 250)
{
jQuery('.img-1').css({
'background-position': "0 -"+(scrollPos*2)+"px"
});
}
jQuery('.carousel-caption').css({
'margin-top' : -(scrollPos/3)+"px",
'opacity' : 1-(scrollPos/300)