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

On window resize > width is not updated #7

Open
n1cus opened this issue Apr 28, 2015 · 5 comments
Open

On window resize > width is not updated #7

n1cus opened this issue Apr 28, 2015 · 5 comments

Comments

@n1cus
Copy link

n1cus commented Apr 28, 2015

When I resize the browser window horizontally, the width value of my DOM element is not updated, nor is the height of the containing div the plugin created.

This causes elements to overlap with other non-fixed page elements.

Thank you!

@ymschaap
Copy link
Owner

Do you have an example use case that I can use to debug?

@n1cus
Copy link
Author

n1cus commented Apr 29, 2015

Yes! I uploaded it to http://szstudios.net/jquery-lockfixed/
Thank you so much!

@n1cus
Copy link
Author

n1cus commented Apr 29, 2015

@ymschaap
Copy link
Owner

You use a fluid width. The issue is when the script locks the container in a fixed position it uses CSS position: fixed. That leads to the container not being restricted to the layout structure anymore. So I first get the width to match with the existing layout. But because you use a fluid layout that becomes more complicated...

I've worked on a fix for your case: https://gist.github.com/ymschaap/de98598fb0ba6c6b8f50

Haven't tested it out extensively in different scenarios yet to push live, but let me know if that works for you.

@n1cus
Copy link
Author

n1cus commented Apr 29, 2015

It is much better! Now the width adjusts!

There is still an issue when making the browser window narrower, sometimes the content of the page will now be taller (because of the reduced browser window width), and when we have a fixed element, it will overlap with the now taller preceding page content.
The fixed element should take this in consideration and "unfix" itself to prevent this overlapping from happening.

Thank you very much for your help and your quick action!

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

2 participants