jquery - Why does $(document).height() return too high number? -


i alerting document height:

alert($(document).height()); 

the result 3307px while full web page has 1800px.

from other answers here on so, learned needed check doctype did , looks this:

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> 

any idea why can document height show higher number expected?

there no hidden elements in page, or that.

edit: reason showing high number @ time of me retrieving document height, menu, containing elements increased overall height.

try :

alert($(window).height()); 

if want , browser window height;


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -