cameronmcefee / plax

JQuery powered parallaxing

Home Page:http://www.cameronmcefee.com/plax

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calculate position based on % rather than px

cibgraphics opened this issue · comments

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)

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.