javascript - jquery code to check page height not seem working correctly -
i have lil piece of jqery code here: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> hasvbar=""; hashbar=""; $(document).ready(function() { // check if body height higher window height :) if ($(document).height() > $(window).height()) { // alert("vertical scrollbar! d:"); hasvbar="y"; } // check if body width higher window width :) if ($(document).width() > $(window).width()) { //alert("horizontal scrollbar! d:<"); hashbar="n"; } }); </script> now in html page first div 200px in height, below div contains 3 paras each in different div. show hide these 3 paras javascript onclick. problem if these 3 divs in hidden state (display:none , visibility:hidden) vertical scroll bar shows up. expecting vertical scrollbar pop if c...