Created
June 24, 2015 18:35
-
-
Save keeganbrown/06cc14a48edcd6b22ee6 to your computer and use it in GitHub Desktop.
Quick N Dirty Parallax
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
function watch_header () { | |
TweenMax.set('.fixed-header-img-obj', { y: ScrollTop/2, z:0.1 }); | |
} | |
TweenMax.ticker.addEventListener( 'tick', function () { | |
watch_header(); | |
}); |
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
.fixed-header-image-obj-wrap { | |
width: 100%; | |
height: 100%; | |
position: absolute; | |
top: 0; | |
left: 0; | |
overflow: hidden; | |
} | |
img.fixed-header-img-obj { | |
position: absolute; | |
min-width: 100%; | |
min-height: 100%; | |
max-width: none; | |
width: auto; | |
-webkit-transform: translate3d(0,0,0); | |
-moz-transform: translate3d(0,0,0); | |
-ms-transform: translate3d(0,0,0); | |
-o-transform: translate3d(0,0,0); | |
transform: translate3d(0,0,0); | |
} |
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
<div class="fixed-header-image-obj-wrap"><img src="" alt="" class="fixed-header-img-obj"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment