S
S
Sergey2015-10-15 18:37:46
JavaScript
Sergey, 2015-10-15 18:37:46

Window.innerHeight doesn't change down?

This is part of the code, the point is that the top property of block 4815... changes depending on the height of the browser window x . This is nonsense, but this is an example. So, when you increase the height of the browser window, the value changes, while decreasing it does not. But if document.getElementById("4815162342").style.top = x+"px"; position after var x = window.innerHeight; , and not in the conditions, the value starts to change downwards.

function resizeBlock() {
  var x = window.innerHeight;
  if{....}
  else{...
    document.getElementById("4815162342").style.top = x+"px";
  }
}
resizeBlock();
window.onresize = resizeBlock;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex K, 2015-10-15
@chelovekmuravei

because when the element is moved below the innerHeight value, innerHeight increases by the size of the element, and when it decreases, nothing changes, because that element is still in the same place

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question