/    Sign up×
Community /Pin to ProfileBookmark

Why is this Happening??

Ok this is so confusing, can someone clarify this for me.

jQuery(function() {
alert(window.innerHeight); // this gives me 950px
alert(document.body.offsetHeight); // this gives me 689px

})

but then if i change the script to this it changes my values

jQuery(function() {
winh = window.innerHeight;
bodyh = document.body.offsetHeight;

alert(winh); // 950px
alert(bodyh); // this gives me 687px WHY?????
})

when i put it into a variable my result changes. Why????
the value changes by 2px
any ideas?????
Thanks for the help!!!

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @juanlr spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...