I have been working on a plugin of wordpress, in which i save the last reading position, the width and height of the browser at the time of closing the browser, I save the width and height with jquery height=$(window).height(); width=$(window).width(); and save the values in database so that when the page is loaded next time, the values are retrieved from database and the screen is scrolled to last reading position and the window get resized to the saved values.
The problem that i m getting is that the window resizes to a very less value and window gets smaller, the jquery methods height=$(window).height(); width=$(window).width(); are saving lesser values, can anybody help me out in this?
Next to .height() and .width() there is .outerHeight() and .innerHeight() (same for width as well). You might be looking for these methods to gather the browsers size, not only the size of the windows viewport.
Keep in mind that this not always works 100% across all browsers, so you always might run into problems if you need it pixel-perfect.