Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

In certain projects that involved a presentation like webpage with storytelling elements, you need containers that always keep the same height as the window itself.
This effect can be achieved using "page-high resizable containers".

The Javascript library jQuery let's us to listen to the "resize" event of the browser window and calculate the height of the containers:

// execute function after page is loaded
$(function(){
  // the resize function
  function resize() {
    $('.page').css('height', $(window).height());
  }
  
  // register the event handler
  $(window).on('resize', resize);
 
  // calculate initial height
  resize();
});