Reputation: 397
I am trying to handle some css via jquery when the viewport at page load doesn't include vertically some specific elements. So I'm trying to evaluate if the window's height is less than the heights of those elements combined. The problem is that this condition
var winH = parseInt($(window).height());
var topH = parseInt($("#name").height()) + parseInt($("#head-001").height());
if( winH > topH);
{
//$("#wrapper").css("top", window.innerHeight - $("#first-bar").height()); what I want to be done if condition passes
console.log(winH + " + " + topH + " =");
console.log(winH + topH);
}
always returns true... no matter if I change the evaluation to <, >, =, === it returns true despite logging the proper values and their sum as per the two lines of testing. Any idea why? Thanks.
Upvotes: 0
Views: 15