Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Parallax Effect: HTML
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Parallax Example</title>
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="parallax-container">
<div class="parallax-layer layer-0" data-parallax-speed="0.05" data-max-scroll="565"></div>
<div class="parallax-layer layer-1" data-parallax-speed="0.1" data-max-scroll="565"></div>
<div class="parallax-layer layer-2" data-parallax-speed="0.3" data-max-scroll="565"></div>
<div class="parallax-layer layer-3" data-parallax-speed="0.5" data-max-scroll="565"></div>
<div class="parallax-layer layer-4" data-parallax-speed="0.7" data-max-scroll="565"></div>
<div class="parallax-layer layer-5" data-parallax-speed="0.9" data-max-scroll="565"></div>
</div>
<div class="content">
<h1>This is parallax.</h1>
</div>
<script src="parallax.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.