Jump to content

How to make Archive dropdown list wider if there is more than 4 items. Only for desktop visitors.

Recommended Posts

Posted (edited)

Hello all,

could you please help me to solve the issue with Archive dropdown list. 
I would like to make the list wider once the column (number of items in column) is bigger than 4.
So if there would be 12 items, list would have 3 columns (4 items in each).

Here is URL: https://www.slovakspots.com/bratislava-accommodation-1
Password: Ulicajekrasnydom

Thank you very much in advance. 🙂 image.thumb.png.1ef1fde871461a2e6dca2adc73bfe78e.png

Edited by GregOvens
Link to comment

@Beyondspace In first place, thank you for your help!
Your approach is good, but I would rather inject code which could expand the dropwdown list based on number of items within dropdown. 

Would it be possible to create code which would be not linked to specific Archive? But it could be used for all archives within my website?

I am planning to have more blogs which would utilise same framework. 🙂 

 

Link to comment

@Beyondspace thank you! I tried new version of your code.

But there is the issue with the wide of the each column within dropdown list as you can seen on screenshots below. If there is longer name, it cause the issue and name is split into the two rows.


Snmkaobrazovky2024-05-11o23_45_34.thumb.png.6c353e06e294df706a8cad925077ad8a.pngSnmkaobrazovky2024-05-11o23_46_00.thumb.png.ff9c60061b222ccb716422db147fdde5.png

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.