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

Calculate position based on % rather than px #19

Closed
cibgraphics opened this issue Apr 11, 2012 · 1 comment
Closed

Calculate position based on % rather than px #19

cibgraphics opened this issue Apr 11, 2012 · 1 comment

Comments

@cibgraphics
Copy link

I am trying to incorporate this into a responsive design, but as soon as the width changes, it breaks (or rather, the px position doesn't change based on it's parent.

Is there a way to calculate position based on % instead of px?

example (live for now). http://beta.cibgraphics.com (change the width of the browser to achieve a different container width and you will see elements are hidden or have too much space depending on how you resize the browser)

@cameronmcefee
Copy link
Owner

Hi @cibgraphics,

At this point plax doesn't support percentages. However, what you want is possible with a little work on your end. You can dynamically change the range by calling plaxify() again. You could set up a window resize event that does the percentage calculation for you and feeds those values into a new plaxify() call.

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