質問

If i use code below to get browser screen size there will be border and scroll bars. I want it to exactly get fitted to window no matter i open toolbars etc. I don't want border spaces and scroll bars. Neither horizontal nor vertical. Can you give me a clue to do it? By the way there is a demo and a screenshot below.

var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight|| e.clientHeight|| g.clientHeight;

enter image description here

役に立ちましたか?

解決

try resetting your css a little

 * html, body {margin: 0; padding:0;}

this worked for me

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top