I've been trying to figure out how this website made the following effect and I can't find the answer.
It seems that while resizing the browser window, the main div resized also with it dynamically by changing the height.
I'm also bad in Math, so please help me to understand the idea behind this awesome effect. It would be also nice to help me figure out how the parallax is working, I mean how can I change the position of the background in css/javascript while resizing the browser window.
$(document).ready(function() {
var $window = $(window);
var $welcomeElement = $(".welcome");
var defaultHeight = $welcomeElement
console.log($welcomeElement);
$window.resize(function() {
// I'm stuck here at math as you see
$welcomeElement.css("height", ($window.width() - $window.height()) -
$welcomeElement.innerHeight());
console.log("Resized!");
console.log($window.height());
});
});