Not working with viewportUnits
Closed this issue · 3 comments
First: awesome work man.
Second: i'm using it on a sticky sidebar, if height
is defined in pixels or not defined at all, works like charm. If viewport units are used, the plugin doesn't init. I've looked at your code, (although my js skills aren't that great) and can't spot anything wrong since elemHeight: $this.height()
should get the value even if defined in vh
. No error is thrown to the console either.
Any thoughts?
Edit: retested and works if height < 90vh
, which is kinda of weird and this is an aprox value
See for yourself: http://codepen.io/ohsimtabem/pen/MYzEKN
I think that your setup is somehow not satisfying this condition (
jQuery-Stickem/jquery.stickem.js
Line 77 in 5959084
This works for me with height up to 99vh http://codepen.io/javiercejudo/pen/gbQoRm (I made overflow-x: hidden
in the body to avoid the horizontal scroll).
PS: there is a PR (https://github.com/davist11/jQuery-Stickem/pull/13/files) to configure how to handle the case in which the container is higher than the window
@javiercejudo well spotted!
That makes sense, and overflow-x:hidden makes it possible to go up to the 99.9vh
which will do the trick.
But somehow on my client's project i can't pass the 94vh
which is odd, have to check what am i doing wrong, but it's probably due a top sticky nav that i've already fixed and the offset that i need.
Thanks for the enlightenment!
No worries. Don't forget to close the issue if you are convinced it isn't a jQuery-Stickem bug.