-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🇬🇧 Added relativeInput and clipRelativeInput functionality. Created `…
…relative.html` example to demonstrate new features.
- Loading branch information
1 parent
f1b54b5
commit fea0ec5
Showing
18 changed files
with
287 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
|
||
<meta charset="utf-8"> | ||
|
||
<title>Parallax.js | Relative Example</title> | ||
|
||
<!-- Behavioral Meta Data --> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> | ||
|
||
<!-- Styles --> | ||
<link rel="stylesheet" type="text/css" href="styles/styles.css"/> | ||
|
||
</head> | ||
<body> | ||
|
||
<div id="container" class="container"> | ||
<ul id="scene" class="scene border"> | ||
<li class="layer" data-depth="1.00"><img src="images/layer1.png"></li> | ||
<li class="layer" data-depth="0.80"><img src="images/layer2.png"></li> | ||
<li class="layer" data-depth="0.60"><img src="images/layer3.png"></li> | ||
<li class="layer" data-depth="0.40"><img src="images/layer4.png"></li> | ||
<li class="layer" data-depth="0.20"><img src="images/layer5.png"></li> | ||
<li class="layer" data-depth="0.00"><img src="images/layer6.png"></li> | ||
</ul> | ||
<br> | ||
<input type="checkbox" id="relative" checked> | ||
<label for="relative">relativeInput</label> | ||
<input type="checkbox" id="clip"> | ||
<label for="clip">clipRelativeInput</label> | ||
</div> | ||
|
||
<!-- Scripts --> | ||
<script src="../deploy/parallax.js"></script> | ||
<script> | ||
|
||
// Elements | ||
var scene = document.getElementById('scene'); | ||
var clipCheckbox = document.getElementById('clip'); | ||
var relativeCheckbox = document.getElementById('relative'); | ||
|
||
// Pretty simple huh? | ||
var parallax = new Parallax(scene, { | ||
relativeInput: relativeCheckbox.checked, | ||
clipRelativeInput: clipCheckbox.checked | ||
}); | ||
|
||
relativeCheckbox.addEventListener('change', function(event) { | ||
parallax.relativeInput = relativeCheckbox.checked; | ||
}); | ||
|
||
clipCheckbox.addEventListener('change', function(event) { | ||
parallax.clipRelativeInput = clipCheckbox.checked; | ||
}); | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.