¿Cómo obtener la altura máxima de pantalla disponible en java script?
Frecuentes
Visto 302 equipos
1
document
/window
outerHeight
provides the size of the window (e.g when the browser windows is re-sized the value changes ).
screen.availHeight
gives you the actual screen size (including the actual browser navigation etc)
I tried creating a fixed div set with top:0,buttom:0
y obtener el outerHeight
but it's also restricted to the window's current size.
What is the best way to get the max available height when the window is maximized ?
Gracias.
EDITAR
The answer, provided with the help of @Greg Burghardt is
screen.availHeight - (window.outerHeight - window.innerHeight)
1 Respuestas
2
Puede que estés buscando:
document.documentElement.offset[Height|Width]
Una buena referencia: A Tale of Two Viewports
contestado el 28 de mayo de 14 a las 13:05
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas javascript css or haz tu propia pregunta.
w3schools.com/js/js_window_screen.asp - user3470953
Couldn't you just set the div's height and width to 100%? - JJJ
@Juhana I'm using a control that requires explicit height. - haki