문제

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