Tagged: icon grid
-
AuthorPosts
-
November 2, 2020 at 12:00 am #1257480
I’m using an icon grid with 6 items in 2 rows and 3 columns. The second row is offset, pushing the last item to a 3rd row. I’ve asked about this issue in the past and it was fixed with some custom but that is no longer working. Any ideas on how to fix this?
November 2, 2020 at 10:29 pm #1257731Hey eliseneonrhino,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaNovember 2, 2020 at 10:31 pm #1257732Hi Victoria – here’s my website https://www.neonrhinomarketing.com/
Thanks!November 2, 2020 at 11:54 pm #1257776Hi eliseneonrhino,
Best regards,
VictoriaNovember 3, 2020 at 5:44 pm #1258073Thank you for your help!
November 4, 2020 at 10:07 pm #1258452Hi eliseneonrhino,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaDecember 17, 2020 at 6:15 am #1268022I have the same issue, except that I have a gap between rows.
Apparently it’s depending on the viewport width (one will find out while resizing the browser window) and the height of the boxes (resulting from the content).Best, Jürgen
- This reply was modified 3 years, 11 months ago by JVo.
December 17, 2020 at 9:31 pm #1268207Hi Jürgen,
https://share.getcloudapp.com/llunEjgw For some reason this block gets a bigger height and so there is that space below.
Best regards,
VictoriaDecember 18, 2020 at 2:48 am #1268286Hi Vic,
yes, that is exactly what I’ve stated above!
If you make the browser window narrower, the blocks become narrower and thus the text lines shorter, resulting in more lines => bigger height.Upon resize event, apparently you recalculate the min-height attribute of each .article-icon-entry.
BUT: Sometimes your calculation is WRONG, since the li ancestor can become taller than the .article-icon-entry! I have ANFI, why this happens.If I look for the tallest li element (in your example 351,19px) the min-height of the .article-icon-entry elements should also become 351,19px. But obviously it is 295.188px (since the outerHeight of tallest .article-icon-entry element is 295.188px).
If I set min-height of the elements manually to the correct value by executing jQuery(‘.article-icon-entry’).css(‘min-height’, “351.19px”), all is good for the moment: the gap is closed (until I resize the browser window).
Digging in your code in iconlist.js, I find these lines:
setMinHeight: function (els) { if (els.length < 2) return; var elsHeights = new Array(); els.css('min-height', '0').each(function (i) { var current = $(this); var currentHeight = current.outerHeight(true); elsHeights.push(currentHeight); }); var largest = Math.max.apply(null, elsHeights); els.css('min-height', largest);
Just calculate currentHeight from the outerHeight of the li parent (instead of the article element itself) like so:
var current = $(this).closest('li');
That did the trick for me (and will do probably for everybody else running into that problem)!
You can thank me later.Best, Jürgen
December 20, 2020 at 9:12 pm #1268858Hi JVo,
Glad you got it working for you and thank you for sharing! :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.