• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Parallax Background

Parallax Background

silence

Well-known member
#1
silence submitted a new resource:

Parallax Background - Dead-simple way to give your website background a parallax effect!

Simply throw this:
HTML:
$(window).scroll(function (e) {
    parallax();
});

function parallax() {
    var scrolled = $(window).scrollTop();
    $('#XenForo').css('background-position', '0px ' + -(scrolled * 0.2) + 'px');
}
Somewhere, where JS is enabled! (I used 'page_container_js_body' and put it right before the '</script>' line.

Example: XenoGamers.org

Note: This only works if you are using the background selector in XenForo's Style Properties and if in 'Miscellaneous' you have...
Read more about this resource...
 

Russ

Well-known member
#4
Not sure if you're aware but scrolling in Firefox is awful on the site, switched to Chrome seems to get the right effect.