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

Fixed element jumps to left on scrolling when right floated #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jackplug
Copy link

There is an offset().left measurement (el_left) but it is not used. Added el_right_float variable - if true, el_left is used to position the fixed element correctly in the horizontal axis.

(Yvo, does this work correctly for you without this amendment?)

There is an offset().left measurement (el_left) but it is not used. Added el_right_float variable - if true, el_left is used to position the fixed element correctly in the horizontal axis.
Sometimes elements are hidden/removed on DOM ready meaning that the initial height value can be incorrect
@ymschaap
Copy link
Owner

Thanks for the commits.The problem with getting the 'left' pixel position is that on browser resize it changes with centered layouts. It's best to left/right float the parent div, like: http://directlyrics.com/code/lockfixed/demo-float-right.html.

ymschaap added a commit that referenced this pull request Apr 28, 2014
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

Successfully merging this pull request may close these issues.

2 participants