jq
var h=$(window).height(); $(window).resize(function() { if($(window).height()<h){ $('.nav').hide();
} if($(window).height()>=h){
$('.nav').show();
}
});
js
var h = document.body.scrollHeight; window.onresize = function(){ if (document.body.scrollHeight < h) { document.getElementsByTagName("nav")[0].style.display = "none"; }else{ document.getElementsByTagName("nav")[0].style.display = "block"; } };