Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Window height less than sticky wrapper #275

Open
kamov opened this issue Mar 5, 2018 · 2 comments
Open

Window height less than sticky wrapper #275

kamov opened this issue Mar 5, 2018 · 2 comments

Comments

@kamov
Copy link

kamov commented Mar 5, 2018

When window height is less than sticky wrapper, it's possible to add scrollable sticky wrapper or disable it?

Since at the moment it's not possible to scroll in this case.

@godsdog
Copy link

godsdog commented Mar 20, 2019

Have the same problem on an actual client site. Just fixed it with the following code:
Put the following code at line 57 in jquery.sticky.js:

// Fix height issue on nearly equal height of document and window height
var preventSticky = false;
if ((documentHeight-windowHeight) < 100) {preventSticky = true;}
if (scrollTop <= etse || preventSticky) {

Change the value 100 to whatever you like. Thats the minimum difference of the window and document height in pixels.

@godsdog
Copy link

godsdog commented Mar 20, 2019

Would be great to add this to the options!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants