There is a menu:
Output php dynamically via ul / li and css 'column-count'. You need to hide part of the menu, but when you click on the button, you need to open it, but this is a trivial problem that has long been solved. The difficulty arose in how to trim the display of the visible part (you only need to display the first 5 in each column), but the height of the columns varies from category to category, since the subcategory texts themselves are of different heights everywhere (the AJAX is also not an option to pull the search engines away). Can someone tell me how to cut the display of the menu. <? $cnt = count($subcats) / 3; $i = 0; ?> <ul> <? foreach ($subcats as $ssubcat): ?> <li class="<?= ($subcat == $ssubcat['cat'] ? 'selected' : '') ?>"><a href='/catalog/<?= $catalogname ?>/<?= $ssubcat['cat'] ?>/'><? =$ssubcat['caption'] ?></a><span class="count_items"> (<?= $ssubcat['objects_count'] ?>)</span>, </li> <? endforeach ?> </ul>
- Show the menu generation code - Kirill Korushkin
- @KirillKorushkin here. I tried to modify the code like that, but nothing was missing. the categories are different and are displayed with a different length (it is chosen that the categories are divided into 3 columns and they are displayed), that is, each time the column turns out to be a different height and you cannot clearly cut it off. - ASYOU
|