Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

overflowX / overflowY #6

Closed
ryanve opened this issue Apr 26, 2012 · 1 comment
Closed

overflowX / overflowY #6

ryanve opened this issue Apr 26, 2012 · 1 comment

Comments

@ryanve
Copy link
Owner

ryanve commented Apr 26, 2012

I've been in the process of improving the docs (beta docs here) and when I got to the overflowX / overflowY methods I was like, whoa these are gonna sound confusing and most people aren't going to use them anyway. We'd had these in there as handlers for inViewport methods, but since version 0.5 we're using getBoundingClientRect and overflowX / overflowY are no longer used internally. IMO it makes sense to depreciate them in 0.6 unless...are there objections? The code is below. It's a native equivalent to $(document).height() - $(window).height() (dims info here) When it's all gzipped the size difference is minimal but still seems like we may as well cut them now rather than support them forever.

function overflowY() {
    // Get the number of pixels that the document width exceeds viewport width.
    var html = document.documentElement
        // document height minus viewport height
      , difference = Math.max(html.offsetHeight, html.scrollHeight, document.body.scrollHeight) - html.clientHeight;
    return 0 < difference ? difference : 0;
}
@ryanve
Copy link
Owner Author

ryanve commented Jun 24, 2012

These 2 methods were removed in 0.6.0. If you still need this functionality, use:

$(document).width() - $(window).width()

and

$(document).height() - $(window).height()

@ryanve ryanve closed this as completed Jun 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant