Reputation: 11615
I am trying to set the width and height of a mask behind a modal window.
I am using $(document).width()
and $(document).height()
.
Works great in FF and Chrome but IE adds about 25px to each and I end up with scroll bars? What am I supposed to use that is cross browser compatible?
I am using IE8 btw, but I want it to work down to 6 or 7.
Upvotes: 3
Views: 1509
Reputation: 11615
If you are trying to fill up the view-port $(window).width()
and $(window).height()
is what you want to use. Works in IE.
Upvotes: 1
Reputation: 168655
Question: Are you using a doctype on your page? It sounds like the kind of glitch you may get if IE goes into quirks mode, which can be avoided if you use a doctype.
If you haven't got one, all you need is a very simple line at the top of your site:
<!DOCTYPE html>
Hope that helps.
Upvotes: 4