Jump to content

Getting visible height and width


shadowayex
 Share

Recommended Posts

I'm looking for a cross-browser bit of code that will allow me to get the height and width of the visible area of the browser. Of course, this means that if scroll bars are present, the height and width need to reflect that as well.I've heard of tricks like window.innerWidth, document.body.clientHeight, etc., but I read that values and support may vary from browser to browser. I was wondering if anyone had a function or something that they used for a task like this.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...