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

Scroll bounce bug on mac #94

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions jquery.sticky-kit.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $.fn.stick_in_parent = (opts={}) ->
enable_bottoming = true unless enable_bottoming?

for elm in @
((elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached) ->
((elm, padding_bottom, parent_top, parent_height, top, height, el_float, detached, scroll_height) ->
return if elm.data "sticky_kit"
elm.data "sticky_kit", true

Expand All @@ -49,6 +49,7 @@ $.fn.stick_in_parent = (opts={}) ->

parent_top = parent.offset().top + border_top + padding_top
parent_height = parent.height()
scroll_height = $(document).height() - win.height()

if fixed
fixed = false
Expand Down Expand Up @@ -101,7 +102,7 @@ $.fn.stick_in_parent = (opts={}) ->

scroll = win.scrollTop()
if last_pos?
delta = scroll - last_pos
delta = if scroll_height > scroll then scroll - last_pos else 0
last_pos = scroll

if fixed
Expand Down
7 changes: 4 additions & 3 deletions jquery.sticky-kit.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions jquery.sticky-kit.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.