What is Parallax scrolling?

Parallax scrolling is an animation technique in which back­ground images move slower than the images in the fore­ground, creating an illusion of depth in an otherwise 2D scene. In order to get a better un­der­stand­ing of the concept, it helps to look into where the word comes from.

A parallax ('par­al­lax' is derived from the Greek word παράλλαξις (par­al­lax­is), meaning 'al­ter­na­tion') refers to a dis­place­ment of an object due to a change in the observer’s point of view. A classic example can be done using your thumb:

  1. Hold your thumb a few inches away from your face.
  2. First close your left eye, then swap to your right eye.

While there is hardly any movement in the back­ground, your thumb will appear to jump from one position to another. The reason for this 'jump' is due to the distance between your eyes, which leads to a change in the point of ob­ser­va­tion when one eye is closed.

The parallax phe­nom­e­non isn’t really given much thought in daily life and yet it belongs to the basics of spatial per­cep­tion.

If you move your head from right to left, you’ll soon see that the relative position of the objects in your field of view changes. Closer objects move in front of and hide objects that are further away. Objects in the fore­ground appear to move faster than the ones in the back­ground, which barely move at all. This effect is es­pe­cial­ly evident in train or car trips.

Imagine you are a passenger in a car and are looking through the window at the expanse of the landscape. You will notice that the signs on the side of the road move much faster than the forests and mountains in the back­ground. The setting sun on the horizon appears to almost stand still.

The following video il­lus­trates this phe­nom­e­non:

Per­cep­tion psy­chol­o­gists call this (apparent) speed dif­fer­ence 'motion parallax'. Light re­flec­tions from nearby objects move faster across the retina than re­flec­tions of objects located further away. Since the effect occurs only when the observer is moving parallel to the objects being looked at, this is known as motion-induced depth per­cep­tion. Further visual stimuli that con­tribute to the per­cep­tion of a three-di­men­sion­al space are vari­a­tions in texture, per­spec­tive con­ver­gence, at­mos­pher­ic per­spec­tive, magnitude constancy as well as masking and over­lap­ping.

The parallax scrolling effect

Game de­vel­op­ers have used the effect of motion parallax since the side-scrolling games of the 1980s in order to produce a three-di­men­sion­al effect using two-di­men­sion­al means. Tra­di­tion­al jump and run games or shoot ’em up games such as Super Mario, Moon Patrol, or Jungle Hunt are comprised of fore­ground, middle, and back­ground levels, which go across the screen at different speeds. While the fore­ground and back­ground move con­stant­ly in one direction, the player can move the game figure around as they wish. The feeling of depth is created due to the fact that the fore­ground moves along the screen faster than the back­ground. This is intended to enhance the ex­pe­ri­ence of immersion while playing. The following demo video of the shoot ’em up classic, Moon Patrol, shows how this looks in practice.

Parallax scrolling in web design

Since the end of the 2000s, the parallax scrolling effect has also been used in web design. The parallax scrolling website, nike­bet­ter­world.com (no longer online) from 2011 attracted a lot of media attention.

The web campaign for the sporting goods man­u­fac­tur­er is con­sid­ered the starting point for a web design trend, which makes use of the parallax scrolling effect to produce an illusion of depth.

Similar to side-scrolling games, parallax websites also use the so-called layer method: the starting point is a single page website where design elements are arranged on different levels and can be moved in­de­pen­dent­ly in a hor­i­zon­tal or vertical direction.

In order to trigger the motion-induced depth per­cep­tion, the website visitor has to navigate through the scenery with the scroll function. The movement and speed of the image are not fixed but are con­trolled by the viewer when they scroll with the mouse or the sidebar. Elements on the fore­ground layers move faster across the screen than elements on the back­ground layers. This gives the im­pres­sion of it being in 3D.

In a few cases, parallax websites also have an auto-scrolling feature, which means the visitor doesn’t have to scroll as much manually. In order to achieve a stronger sense of immersion, some web de­vel­op­ers also use sound and video effects alongside parallax scrolling, which comes into effect when the viewer is at a certain place on the website.

Note

When it comes to single page websites (also known as one pagers), this refers to web projects, which are comprised of a single HTML document and whose content is dy­nam­i­cal­ly loaded as the visitor is in­ter­act­ing with the site (i.e. scrolling down). Parallax websites are generally created as one pagers.

Tech­ni­cal­ly, parallax scrolling websites can even be im­ple­ment­ed with basic web standards such as Hypertext Markup Language (HTML) and Cascading Style Sheets (CSS), which provide de­vel­op­ers with extensive an­i­ma­tions in the current versions, HTML5 and CSS3. For example, you can use a simple parallax scrolling effect with the CSS property at­tach­ment. If this is used together with the fixed value, the chosen element will remain in a fixed position while other elements move in the direction the viewer is scrolling. If you want to define different scroll speeds for fore­ground and back­ground layers, you need ad­di­tion­al web tech­niques.

The following video tutorial from YouTuber, Drew Ryan, shows how moving layers can be im­ple­ment­ed over a still back­ground with HTML5 and CSS3.

In order to enhance the depth per­cep­tion, more complex parallax scrolling websites rely on the JavaScript script language or the JavaScript framework, jQuery. These provide various functions that can be used to determine exactly how the in­di­vid­ual layers of a website should behave when scrolling. In this case, scrolling effects based on JavaScript don’t need to be pro­grammed from scratch. Online, you will find various software projects that provide you with parallax effects and other an­i­ma­tions in the form of easy-to-integrate plugins. Among the best-known projects are Su­per­Scrol­lo­rama, Scroll­Mag­ic, and skrollr.

  • Su­per­Scrol­lo­rama by John Polacek: the jQuery plugin Su­per­Scrol­lo­rama is based on the Greensock Animation Platform (GSAP) and was designed by John Polacek in col­lab­o­ra­tion with Jan Paepke. The plugin offers various animation pos­si­bil­i­ties for website elements and has long been the standard solution for scrol­lable web design. Su­per­Scrol­lo­rama sees the scrolling bar as a kind of progress bar where the desired an­i­ma­tions line up. If a website visitor reaches a pre-defined point during the scrolling, the effect is triggered. The plugin is still available for download but is currently not being further developed. Instead, the de­vel­op­ers are con­cen­trat­ing on the successor project Scroll­Mag­ic. Su­per­Scrol­lo­rama is under MIT and GPL license.
  • Scroll­Mag­ic by Jan Paepke: Scroll­Mag­ic is a complete revision of the jQuery plugin, Su­per­Scrol­lo­rama. Scroll­Mag­ic relies on jQuery and the Greensock Animation Platform (GSAP). However, these are not part of the software kernel and must be provided sep­a­rate­ly. As an al­ter­na­tive to GSAP, the animation engine Velocity.js can be used. Scroll­Mag­ic offers all the animation effects, which are dependent on the scrollbar, that its pre­de­ces­sor does and extends its func­tion­al spectrum by its improved per­for­mance, support for re­spon­sive design and mobile devices, as well as object-oriented pro­gram­ming. In addition to a variety of parallax scrolling effects, Scroll­Mag­ic offers an infinite scrolling feature that loads web page content in an endless loop using Ajax. Like its pre­de­ces­sor, Scroll­Mag­ic is under dual license (MIT and GPL license).
  • skrollr by Alexander Prinzhorn: Skrollr also uses the slide bar as the starting point for animation effects. The light­weight plugin only includes JavaScript and CSS libraries and manages com­plete­ly without jQuery (Vanilla JS). Knowledge of the script language is not a re­quire­ment for using the ap­pli­ca­tion but ex­pe­ri­ence with CSS3 and HTML5 is a must. The program skrollr is suitable for desktop websites and supports mobile web browsers and Android and iOS. Users should note that the project has not been actively developed since 2014. Support for newer web browsers can’t be guar­an­teed. The software is available for download under MIT license.
Note

The heavy use of scripts for animating web pages can have a negative impact on your web project’s per­for­mance. When using frame­works and libraries, you should ensure that they are supported by all current web browsers. Otherwise, there is a risk that some of the internet community will not be able to visit your site.

Parallax scrolling examples: hits and misses

While some users welcome designs with motion-induced depth stimuli, others may tire of these in­no­v­a­tive stylistic elements. This is es­pe­cial­ly the case when parallax scrolling is used as an end in itself without con­cep­tu­al context. Whether parallax effects enrich your web offer depends primarily on what you aim to achieve with your website and who you’re targeting. Parallax scrolling has proven itself as a stylistic tool for visual sto­ry­telling.

The Hybrid Graphic Novel

A project that excels in this area is the marketing website for the Peugeot Hybrid4, which is in the guise of a graphic novel and uses lots of in­ter­est­ing features (at the time of pub­li­ca­tion) of the new drive tech­nol­o­gy in the form of an action-packed picture story.

The concept and design of the single page website were developed by BETC Digital in col­lab­o­ra­tion with the MARVEL il­lus­tra­tor Gerald Parel. The technical im­ple­men­ta­tion was carried out by the French digital agency 60fps under the direction of Sylvain Tran.

The online graphic novel provides visitors with two ways to navigate through the web pages: those who do not want to scroll con­tin­u­ous­ly can activate the auto-play mode. This means that the animated web page elements will be au­to­mat­i­cal­ly played without the user having to do anything. In addition to the parallax scrolling effect, the website uses sound design con­trolled by the scroll bar.

Tech­ni­cal­ly, the front-end is based on HTML5, CSS, and JavaScript. The project was awarded the FWA of the Day award from The FWA website.

Note

The FWA (Favourite Website Awards) is one of the best-known award platforms regarding web design. Since the early 2000s, an in­ter­na­tion­al judging team has been al­lo­cat­ing the awards: FOTD (FWA of the Day), FOTM (FWA of the Month), PCA (People’s Choice Award) and FOTY (FWA of the Year). The website is a source of in­spi­ra­tion for creative people around the world.

Ben the Bodyguard

A similar use of the parallax scrolling effect can be seen on the iOS password tool website, Ben the Bodyguard (App no longer available).

Visitors to the single page website accompany Ben through a gloomy street scene and are met with some fears of the digital era: un­pro­tect­ed photos and contact details on your smart­phone. There’s no need to worry since Ben acts as your phone’s bodyguard and protects sensitive data against the dangers of the internet with a secure 256-bit en­cryp­tion.

The Berlin creative agency, Nerd Com­mu­ni­ca­tions, is the mas­ter­mind behind the password tool and website. When im­ple­ment­ing this one pager website, the de­vel­op­ers used various tools, libraries, and frame­works such as jQuery, HTML5 Boil­er­plate, and Adobe Flash. Scrolling with parallax effects is based on the platform-in­de­pen­dent Javascript scroller iScroll, developed by Matteo Spinelli. The single-page website was part of a cross-media marketing campaign to introduce the password tool. The pro­tag­o­nist, Ben, meets in­ter­est­ed people in the YouTube in the trailer, on various social networks, as well as on the app’s user interface. Ben­the­body­guard.com was also able to secure the title of FWA of the Day from the FWA. The tool has now dis­ap­peared from the App Store.

The Walking Dead Zom­biefied

CableTV.com, an in­for­ma­tion platform about US cable TV, has also made use of parallax scrolling in its sto­ry­telling. The Walking Dead Zom­biefied is an in­ter­ac­tive in­fo­graph­ic of the AMC cult series.

In the form of a virtual comic script, the single-page site il­lus­trat­ed how an actor changes from a normal person to the undead (known as Walker in the series).

Website visitors follow the story by scrolling with the mouse. The different layers on the Parallax website pass hor­i­zon­tal­ly past the viewpoint. New content is au­to­mat­i­cal­ly reloaded. Sound effects and dark music, which play in time to the scrolling, ensure there’s a post-apoc­a­lyp­tic mood. According to the developer team, the source for in­spi­ra­tion for the scary Zombie website was the company pre­sen­ta­tion by the US security service provider ADT, which has a timeline with parallax scrolling effect on your­localse­cu­ri­ty.com. The technical basis of one pagers is the JavaScript plugin skrollr.js. The makers of The Walking Dead Zom­biefied show just how fast a parallax website with video game optics can be created. You’ll find the in­for­ma­tion in a blog post on Dev.Opera.com.

NASA: Prospect

NASA has also realized that scroller websites are an ideal way of providing in­for­ma­tion online in an en­ter­tain­ing way. On the in­fo­tain­ment website, nas­aprospect.com, the US space agency takes visitors on a journey through the solar system, using the parallax scrolling effect to present the vast expanse. The website visitor enters the role of space explorer and scrolls from planet to planet, while the stars whizz past in the back­ground.

The website was developed in col­lab­o­ra­tion with design students at the Uni­ver­si­ty of South Dakota and the in­ter­na­tion­al youth art com­pe­ti­tion Humans in Space Art. In addition to the basic HTML5, CSS3, and JavaScript web tech­nol­o­gy, the libraries: Modernizr, LESS, Bootstrap, Require, jQuery, Signals, Sound­Man­ag­er2 as well as Greensock Tweening Engine are also used. The parallax scrolling effect is based on the jQuery plugin, stellar.js of Mark Dalgleish. The website’s source code is available on GitHub under the MIT license. The project has been awarded for its creative, in­no­v­a­tive web design by various award websites such as The FWA, Awwwards.com, and CSS­Des­ig­nAwards.com.

Tip

Parallax effects sup­ple­ment visual sto­ry­telling by creating depth and dynamics and enables a stronger immersion so the reader can position them­selves in the scenes and story.

Firewatch

The parallax effect is also an eye-catcher when the visitor first clicks onto the page since they are wowed by the stylistic design and the potential it has for telling the story in different ways. A prime example is the Firewatch video game site from Campo Santo.

The header of the website shows the visitor a mountain landscape at dusk. It consists of six graded layers, which asyn­chro­nous­ly move out of the field of view when the visitor starts scrolling, thus em­pha­siz­ing the landscape’s expanse. The actual contents of the website – in­for­ma­tion about the game, a trailer, as well as links to various gaming platforms – glide into view on the fore­ground layer.

Various web tutorials and code examples show how well the parallax effect on the Firewatch website comes across to the internet community. Here, you’ll find step-by-step in­struc­tions, which enable you to replicate these designs. For example, you’ll find a demon­stra­tion on CodePen.io.

Tip

Parallax effects can also be used as eye-catchers, which get visitors in­ter­est­ed in your website and emphasize the content. Too many gimmicks, on the other hand, end up being annoying. In the worst case, an excessive amount of animation distracts the visitor and may cause them to leave the site.

Green­splash

It may work great when it comes to sto­ry­telling but could end up being annoying on websites that focus on other things, es­pe­cial­ly if visitors want to get in­for­ma­tion quickly without being led on a detour. An example of this is the web design agency, Green­splash. Here, the parallax scrolling effect is for their own benefit and has no con­nec­tion to the other design elements on the website.

The website visitor is presented with a funny picture: two nerdy primary school kids with strainers on their heads. There’s an ape next to them, taking notes. When you scroll down, the photo dis­ap­pears from view. This optical 'high­light' also comes with a green loading bar, which creeps across the screen as the website’s loading. Not very well designed.

Tipp

Vermeiden Sie optische Effekte, die ihr Webpro­jekt nicht wesentlich bere­ich­ern. Vor allem dann, wenn diese auf Kosten der Website-Per­for­mance gehen.

Ala

The Swiss web and interface design agency, Ala shows that an elaborate design doesn’t have to affect website per­for­mance. The visitor is presented with a crazy collage of random un­con­nect­ed projects. It might be an overload for the senses but is there to demon­strate the range of possible animation effects and the technical skills that the de­vel­op­ers possess. Despite the elaborate design, the an­i­ma­tions move smoothly across the screen without any delays.

A small con­so­la­tion for fans of sleek website designs: you don’t have to get lost looking for important in­for­ma­tion amongst the crazy an­i­ma­tions on the website; every­thing you need is luckily contained in the header.

Happy 25th Birthday Game Boy

Even if the parallax effect can be automated in principle, most de­vel­op­ers of single page websites with ap­pro­pri­ate an­i­ma­tions rely on nav­i­ga­tion where visitors control the scrolling them­selves. There is, however, a limit to how much a visitor is prepared to scroll. An example of a website that tests its visitors’ patience is ihate­toma­toes.net. The website used for the 25th an­niver­sary of the Gameboy doesn’t use parallax effects but requires the visitor to do A LOT of scrolling.

The single-page site acts as an ad­ver­tis­ing campaign. Those in­ter­est­ed will register on ihate­toma­toes.net to receive the tutorial on the basic features of the animation plugin, Scroll­Mag­ic. Visitors first see a Gameboy on a gray back­ground and when they scroll down, the Gameboy becomes bigger and a game of Tetris starts. However, the viewer can’t play the game and must instead keep scrolling while watching the blocks stack them­selves on the Gameboy’s screen. At the bottom of the website, you will see a link to video tutorials that you have to pay for.

Tip

Scroller websites with parallax effects should be fun. If you make your visitors scroll until their finger is tired, you run the risk of them skipping the end (i.e. the call to action).

GitHub 404

GitHub’s 404 error page (source: 'https://github.com/404') is an example of parallax effect without the need to scroll. It behaves in a similar way to a parallax website but the visitor doesn’t have to scroll, instead, he or she simply has to move the cursor around.

The jQuery plugin Plax is behind the parallax animation. This plugin was developed by Cameron McEfee and is free to use via GitHub under the MIT license. What’s special about Plax: the Parallax plugin turns the website visitors’ per­cep­tion upside down. Here, the fore­ground doesn’t move faster than the back­ground - rather the back­ground moves faster than the fore­ground. The aim is to dis­ori­en­tate the viewer, which is fitting since the visitor is probably already confused after having been redi­rect­ed to this error page.

Summary

The question 'parallax websites: yes or no?' is hard to answer. In principle, the parallax effect is very eye catching. Yet, because this stylistic design has been used a lot (sometimes un­nec­es­sar­i­ly) since 2011, these sites have become quite annoying, es­pe­cial­ly when nav­i­gat­ing isn’t as easy as the developer has planned. You should consider the following points:

  • If parallax scrolling isn’t used in visual sto­ry­telling, you should use the effect sparingly.
  • Parallax effects and other an­i­ma­tions should improve the user ex­pe­ri­ence, highlight content, products, and services, and encourage visitors to make content.
  • If an effect has a negative impact on the site’s per­for­mance, you should consider whether you actually need it.
  • The site should be ac­ces­si­ble to all internet users, despite the parallax scrolling effect. Only use up-to-date tech­nolo­gies that are downward com­pat­i­ble and work with both old and new web browsers.
  • Ensure that your parallax website can also be displayed on mobile devices. Current parallax plugins generally support re­spon­sive web design.
Go to Main Menu