Created
June 27, 2017 13:17
-
-
Save cedeber/7c9c6678a26a0fbefdadf32c4086e759 to your computer and use it in GitHub Desktop.
Image as Hero
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() { | |
var image = document.getElementById("image-${content.@id}"); | |
var imageTop = (function() { | |
var element = image, top = element.offsetTop; | |
while ((element = element.offsetParent) !== null && element !== document.body) { top += element.offsetTop; } | |
return top; | |
}()); | |
image.style.height = (window.innerHeight - imageTop) + "px"; | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment