JSFiddle - React, Tailwind, and code Playground

by karthick Chandran

HTML

<div style="height:1000px;"  class='wrap'>
    test data
    test data
    test data
    test data
    
</div>

JavaScript

jQuery(document).ready(function($) {
    var $window = $(window);
    var $pageHeight = $('.wrap').height();
    function checkWidth() {
        var windowsize = $window.height();
    console.log('window height '+ windowsize);
    console.log('div height ' +$pageHeight);
        if (windowsize < $pageHeight) {
            $('body').addClass('need-padding');
        }
    }
   
    checkWidth();   
    $(window).resize(checkWidth);
});