window resize event

In this example below you will see how to do a window resize event with some HTML / CSS and Javascript

This awesome code was written by FlotDag, you can see more from this user in the personal repository.
You can find the original code on
Copyright FlotDag ©
  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

  <meta charset="UTF-8">
  <title>window resize event</title>
      /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */
      body {
  background-color: #000;


    <script src=""></script>



  <script src=''></script>


    <script  src="js/index.js"></script>



/*Downloaded from */
body {
  background-color: #000;

/*Downloaded from */
var resizeTimer;

  $(window).on('resize', function(){
    resizeTimer = setTimeout(function(){
      console.log('resize done');
    }, 250);