-
Notifications
You must be signed in to change notification settings - Fork 262
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
[Question] Using the hexagrid in a div #23
Comments
I created this example: https://jsfiddle.net/w1o7kzow/2/ |
@MinThaMie the behaviour you see is the normal behaviour. If you stretch width of the result window in the codepen, you will see that the grid adjusts to 2-3 hexagons per row. As you only have 4, and the fifth one is missing, it looks like the grid isn't centered. I suppose (you haven't explained what you want) that you want the grid to always display 1-2 hexagons per row. For this, you just need to modify the CSS:
|
Thanks for the answers, for some reason the extra div broke the height of the |
On a side note, you should use the CSS from the repo rather than the one on Codepen as it isn't maintained there. |
@web-tiki did we ever test the grid in safari? |
@poi33 the grid has been successfully tested on safari and firefox and no prefixes are missing. |
I'm really sorry. I managed to forget one crucial class :( |
No problem. |
I'm using your grid as follows:
<div id="honeycomb"><ul id="hexGrid"></ul></div>
and then dynamically append the list items with jquery like this:
$("#hexGrid").append('<li class="hex"><a class="hexIn" href="#"><img src=' + data[i].photo + ' alt="" />' + '<h1>' + data[i].employee_id + '</h1><p></p></a></li>');
And even though the parent div is larger the hexGrid does not stretch as nicely as in your examples. I did not change any code and took the code from this codepen: https://codepen.io/web-tiki/pen/wWGeEM
Hopefully one of you can help me to figure this out, because it looks not so nice now :(
The text was updated successfully, but these errors were encountered: