Skip to content

Instantly share code, notes, and snippets.

View Jadeng24's full-sized avatar

Jaden Goodwin Jadeng24

View GitHub Profile
@Jadeng24
Jadeng24 / parallax.html
Created September 28, 2017 03:43 — forked from hamstu/parallax.html
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>
@Jadeng24
Jadeng24 / style.css
Created September 28, 2017 03:44 — forked from hamstu/style.css
Parallax Example: CSS
body {
background: #415a6c;
margin: 0;
font-family: 'Oswald';
}
.parallax-container {
position: fixed;
overflow: visible;
width: 100%;
height: 850px;
@Jadeng24
Jadeng24 / parallax.js
Created September 28, 2017 03:46 — forked from hamstu/parallax.js
Parallax Example: JavaScript
var ParallaxManager, ParallaxPart;
ParallaxPart = (function() {
function ParallaxPart(el) {
this.el = el;
this.speed = parseFloat(this.el.getAttribute('data-parallax-speed'));
this.maxScroll = parseInt(this.el.getAttribute('data-max-scroll'));
}
ParallaxPart.prototype.update = function(scrollY) {