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

Position items with percent values. Nicer when resizing #236

Closed
jerzygangi opened this issue Jan 18, 2015 · 2 comments
Closed

Position items with percent values. Nicer when resizing #236

jerzygangi opened this issue Jan 18, 2015 · 2 comments

Comments

@jerzygangi
Copy link

When a user drags his mouse to resize the browser window, packery waits for the user to stop dragging before triggering a re-layout based on the new window width. This can lead to ugly layouts while the user is in mid-drag.

Is there any way to constantly trigger a re-layout while the window is being resized?

@desandro
Copy link
Member

Hi there! Thanks for this feature request. Rather than constantly triggering layout, I think a better solution would be to position items with percent values (as opposed to pixels). This has been requested for Masonry desandro/masonry#574

I've got a working example: http://codepen.io/desandro/pen/EamjJJ

This adds a new option, percentPosition: true. It sets position of the column in percentage. To use the code, add the Outlayer.Item.prototype.layoutPosition code.

If others would like to see this feature merged into production, please +1

@desandro desandro changed the title Re-layout while window is being resized Position items with percent values. Nicer when resizing Jan 18, 2015
@desandro
Copy link
Member

Packery v1.4 now has percentPosition option. See demo http://codepen.io/desandro/pen/tonpx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants