javascript - jquery Window Height getting same when Load and After Resize -


i trying adjust div height based on browser window height. getting same height when page/body being load , after resize browser window.

function setdivheight() {     var bodyheight = $(document).height();     document.getelementbyid('divname').style.height = (bodyheight - 180) + "px"; }  function pageload() {     setdivheight(); }  window.onresize = setdivheight(); 

// returns height of browser viewport // use $( window ).height();  // returns height of html document $( document ).height(); 

example from: http://api.jquery.com/height/


Comments

Popular posts from this blog

html - height not adding height to a empty div -

python - Robot Framework location and name of keyword -

Desktop Launcher for Python Script Starts Program in Wrong Path (Linux) -