JSFiddle - React, Tailwind, and code Playground

by danhaswings

HTML

<div id='main_wrapper'></div>

CSS

html {
    height: 100%;
    width: 100%;
    position: relative;
}

#main_wrapper {
    height: 100%;
    width: 100%;
    background-color: blue;
    position: absolute;
}

JavaScript

// cache objects to minimise DOM lookups
var $main_wrapper = $('#main_wrapper');

// on window resize
$(window).resize(function() {

    console.log('The window has resized.');

    // random example to run on window resize
    $main_wrapper.css({
        'background-color': 'red'
    });

});