Can you please tell me if there is a chip that would determine the height of the screen in real time?

there is such a topic

$(window).height() 

but it determines when loading the page, but is it necessary in real time ?! Those. any window resizing, without reloading the page!

  • the event is resize is called. - zb '
  • Can I give an example, I'm just learning ?! ((suppose I have a div that has the display: fixed property, when the window is reduced to 800px, it should become display: absolute - Dimastik86
  • jquery.page2page.ru/index.php5/… ps better use pure js - heleg
  • your thing doesn't work - heleg

2 answers 2

And in jquery:

 $(function(){ $(window).resize(function() { alert( $(window).height() ); }) }) 

    As I already answered here

    You can get this information, here's the article: Viewports on mobiles are true, it’s English, but an approximate translation [The Tale of Two Viewports] [2] is about triggering the window.onresize event and resizing the <HTML>
    For example, you can do this:

     window.onresize = function () { width = document.documentElement.clientWidth; height = document.documentElement.clientHeight; }