Link to home
Create AccountLog in
Avatar of Henrik_Nyholm
Henrik_NyholmFlag for Thailand

asked on

How to get window height and width within all major browsers?

Dear Experts!

I want to make a div as a semi transparent layer (opacity 80%) on top of the whole body of the web page.

How do I get the height and width of the window/body of the html page to set on the div?

It needs to be a cross browser solution.

Thank you

Regards
Avatar of Roman Gherman
Roman Gherman
Flag of Moldova, Republic of image

<div id="loadingContainer">
    <!--[if lt IE 6.5]><iframe></iframe><![endif]-->
</div>


#loadingContainer
{
      cursor: wait;
      text-align: center;
      position: absolute;
      filter: alpha(opacity=50);
      -moz-opacity: .50;
      opacity: .50;
      background-color: silver;
      width: 100%;
      height: 100%;
      z-index: 100;
}
ASKER CERTIFIED SOLUTION
Avatar of Gurvinder Pal Singh
Gurvinder Pal Singh
Flag of India image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
I suggest you look at the jQuery UI dialog. Takes away a lot of hassle with modal dialogs.