Question

Any idea or explanation how they did the backgrounds of this site? http://upcircuit.org/ Basically, a fixed background is the trick here. But there are multiple backgrounds and I am trying to solve the tricks of this site :)) I tried scanning the page source but I have no idea how they did this.

Was it helpful?

Solution

They have panels that are the size of the window. Then what they are doing is setting a background image for each panel and setting its background-attachment: fixed so that it stays positioned relative to the window, not the div it is in.

I set up the fundamentals for you here: http://jsfiddle.net/Zc822/

body, html {
    width: 100%;  // Sets the html and body width and height 
    height: 100%; // to the width and height of the window.
    margin: 0;
}
.panel{
    width: 100%;  // Sets each panel to the width and height
    height: 100%; // of the body (which is set to the window)

    background-repeat: no-repeat;
    background-attachment: fixed;  //Sets background fixed in window
    background-size: cover;
}

Then you just need to specify a background-image for each individual panel.

Pretty sure this is what you are looking for.

OTHER TIPS

What have you tried? Have you tried to use

background-attachment: fixed;

Hope this helps.

This is a parallax effect, which emulates a 3D space by having your foreground and background move at different speeds. It looks like images are perhaps swapped out and fixed at certain scroll spots. You'll need to use a little javascript, but it is not too difficult a trick to pull off:

Here's a library to help:

http://matthew.wagerfield.com/parallax/?utm_medium=App.net&utm_source=PourOver

Here's another neat site that does some neat things with parallax and scrolling: https://www.google.com/nexus/5/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top