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

Option to change the width of the person divs #2

Open
justincy opened this issue Jun 25, 2014 · 3 comments
Open

Option to change the width of the person divs #2

justincy opened this issue Jun 25, 2014 · 3 comments

Comments

@justincy
Copy link
Member

The person divs are hard-coded to be 180px wide. There should be an easy way to change that.

@justincy
Copy link
Member Author

Note that the JS needs to what the width of the person objects are so that it can calculate horizontal spacing.

There are different ways to do this while still allowing the width to be changed:

  1. Change nothing. Just document where to change the width in both the CSS and JS.
  2. Only specify the width in the CSS and detect it automatically via JS.
  3. Only specify the width in the JS (dynamically as an option) and add the CSS width rule via JS.

@justincy
Copy link
Member Author

I think I prefer (2) because (3) could get messy if the width is changed after the page has loaded and (1) is just meh.

@justincy
Copy link
Member Author

The best way to detect the width via JS is to add an element with the person class onto the page, detect it's width, then remove. The great thing about this is it doesn't matter whether you change the width in the original CSS file or override it with your own rule; it will always properly detect what the width is going to be when it's displayed.

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

1 participant