Handy Tool – jQuery Waypoints

Why You Might Need Waypoints

If you need to fire off a function when the user scrolls and reveals a particular element in the viewport.

Read More »

Advertisements

The Incredible Expanding Empty Space

The Problem

Some pages didn’t have enough content and the footer would start floating up and the site designs didn’t call for a sticky footer.

My Solution


"
"


    var header_height = jQuery("header").height();
    var content_height = jQuery(".wrap").height();
    var footer_height = jQuery(".footer-container").height();
    var window_height = jQuery(window).height();
    var all_content_height = header_height + content_height + footer_height;
    var gap;
    
    if (all_content_height < window_height) {
        gap = window_height - all_content_height;
        jQuery('.void-balloon').css("height",gap)
    } else {
        console.log('no content gap detected');
    }