Why am I getting nan back from a variable and not a number : why is it when I alert either of cont_home_h or cont_other_h I get nan? but if I alert the variables wind_h, slider_h or head_img_h I get a their height. Have I done the calculation wrong? if you need the css I will create a demo but I'm hoping you can just see an error it this jQuery. Thanks

<!-- language: lang-js -->

    /*no scroll on content when nav is open*/   
            var wind_h = jQuery(window).height();  
            var slider_h  = jQuery(".slider").height();
            var head_img_h = jQuery(".head").height();

            var cont_home_h = wind_h - slider_h;
            var cont_other_h = wind_h - head_img_h;

            var cont_wrapper = jQuery(".page_cont_wrapper");
            var slider = jQuery(".slider");
            var head_img = jQuery(".head");

            if(slider.length && jQuery("#hd_ft_cont").hasClass("open_nav")){
                cont_wrapper.css("height", cont_home_h);
                cont_wrapper.addClass("no_scroll");
            }else{
                cont_wrapper.css("height", "auto");
                cont_wrapper.removeClass("no_scroll");
            }

            if(head_img.length && jQuery("#hd_ft_cont").hasClass("open_nav")){
                cont_wrapper.css("height", cont_other_h);
                cont_wrapper.addClass("no_scroll");
            }else{
                cont_wrapper.css("height", "auto");
                cont_wrapper.removeClass("no_scroll");
            }

            jQuery(window).resize(function(){
                var wind_h = jQuery(window).height();  
                var slider_h  = jQuery(".slider").height();
                var head_img_h = jQuery(".head").height();

                var cont_home_h = wind_h - slider_h;
                var cont_other_h = wind_h - head_img;

                var cont_wrapper = jQuery(".page_cont_wrapper");
                var slider = jQuery(".slider");
                var head_img = jQuery(".head");

                if(slider.length && jQuery("#hd_ft_cont").hasClass("open_nav")){
                    cont_wrapper.css("height", cont_home_h);
                    cont_wrapper.addClass("no_scroll");
                }else{
                    cont_wrapper.css("height", "auto");
                    cont_wrapper.removeClass("no_scroll");
                }

                if(head_img.length && jQuery("#hd_ft_cont").hasClass("open_nav")){
                    cont_wrapper.css("height", cont_other_h);
                    cont_wrapper.addClass("no_scroll");
                }else{
                    cont_wrapper.css("height", "auto");
                    cont_wrapper.removeClass("no_scroll");
                }
            });

<!-- end snippet -->

