nfw
nfw

Reputation: 4202

How can I get the full height of a web page that uses a master page?

I'm writing a script that creates a popup that dims the screen behind the popup. I'm using JQuery's $("#dim").css("height", $(document).height()); to resize the div element in question, but it doesn't cover the master page area. Is there a way I can get the height of the WHOLE page and not just the child page?

EDIT: The problem may actually lie in the positioning, and not the size, of my div. I have it set to top:0, but maybe I need to move it using javascript?

Upvotes: 2

Views: 849

Answers (2)

Blazemonger
Blazemonger

Reputation: 92923

Since .outerHeight() isn't supported for window or document, you'll have to add the padding to the height() yourself.

$("#dim").css( "height", $(document).height() + 2*parseInt($(document).css("padding"),10) ); 

Upvotes: 2

James Johnson
James Johnson

Reputation: 46057

Give this a shot:

var width = screen.availWidth;
var height = screen.availHeight;

Upvotes: 3

Related Questions