godfather/contents/js/custom.js

46 lines
1.1 KiB
JavaScript

WebFontConfig = {
google: { families: [ 'Arimo:400,700:latin' ] }
};
(function() {
var wf = document.createElement('script');
wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
'://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
jQuery(document).ready(function(){
var windowWidth = window.screen.width < (window.outerWidth ? window.screen.width : window.outerWidth);
var mobile = windowWidth < 500;
if(mobile)
{
jQuery(window).scroll(function() {
scroll_effect();
});
}
});
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)
});
if (scrollPos > 400)
{
jQuery('.middle').css({
'height': (scrollPos-250)/2+"px"
});
}
}