Jump to content

shop categories in drop down menu on mobile

Recommended Posts

Site URL: https://www.stilllisteningmagazine.com/still-listening-shop

Hello,

Please can someone help me make my shop nicer on mobile view. Ideally it would be great to have the categories in some kind of drop down menu but not sure how hard that would be? 

Also, it would be nice if the title was a bit more centre. I've attached a photo of what I mean. 

Any help would be really appreciated!

256876964_634222101067133_3366775359133473744_n.jpg

Link to comment
2 hours ago, elzzzzer said:

Site URL: https://www.stilllisteningmagazine.com/still-listening-shop

Hello,

Please can someone help me make my shop nicer on mobile view. Ideally it would be great to have the categories in some kind of drop down menu but not sure how hard that would be? 

Also, it would be nice if the title was a bit more centre. I've attached a photo of what I mean. 

Any help would be really appreciated!

256876964_634222101067133_3366775359133473744_n.jpg

You mean turn the attached screenshot to dropdown right?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace (+100 Spark plugin customisations)
🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

Link to comment

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 No-code customisations for Squarespace (+100 Spark plugin customisations)
🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

Link to comment
On 11/22/2021 at 8:50 PM, elzzzzer said:

Hello,

Yes I want to turn the categories into a drop down. I clicked on the click and used the code but it doesn't work. 

Try adding the code then check on real mobile, don't check in preview edit mode

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
On 11/23/2021 at 9:24 PM, elzzzzer said:

Hey Tuanphan,

Thanks for helping. So I've done that and it still won't change anything on the mobile version.

Cheers

Try this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
    if(window.innerWidth <= 575 && $('.nested-category-children li a').length > 0) {
        let open = false
        $('<div id="t-category" name="t-category"><div id="t-control">Category <span id="t-down"></span><span id="t-up"></span></div><div id="t-menu"></div></div>').insertBefore('.nested-category-tree-wrapper');
        $('.nested-category-children li a').each(function(id, e) {
            const href = $(e).attr('href');
            const text = $(e).html();
            $('#t-menu').append('<a class="t-item" href="'+href+'">'+text+'</a>')
        })
        $('#t-control').click(function() {
            if (!open) {
            $('#t-menu').css('display', 'block')
            $('#t-down').css('display', 'none')    
            $('#t-up').css('display', 'unset')
            open = true
            } else {
                $('#t-menu').css('display', 'none')
            $('#t-down').css('display', 'unset')    
            $('#t-up').css('display', 'none')
            open=false
            }
        })
    }
})
</script>
<style>
#t-category {
    display: none;
}
@media only screen and (max-width: 575px) {
    .nested-category-children {
        display: none !important;
    }
    #t-menu {
        position: absolute;
    top: 35px;
    z-index: 1;
    background: white;

    display: none;
    right: 0;
    text-align: right;
    
    }
    #t-category {
        position: relative;
        display: inline-block;
        float: right;
        top: 5px;
        right: 0;
    }
    .nested-category-title {
        display: inline-block !important;
    }
    #t-control {
        font-family: baskerville-display-pt;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0em;
    text-transform: none;
    z-index: 12;

    font-size: 20px;
    position: absolute;
    top: 0;
    right: 0;
    padding-right: 20px;
    }
    .t-item {
        display: block;
        padding-left: 15px;
    }
    #t-down {
margin-left: 10px;
      position: absolute;
    top: 15px;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-top: 10px solid;
    right: 0;
    }
    #t-up {
       margin-left: 10px;
      position: absolute;
    bottom: 12px;
    right:0;
      border-left: 5px solid transparent;
      border-right: 5px solid transparent;
      border-bottom: 10px solid;
      display: none;
    }
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Hey tuanphan,

Thanks! This code seems to be getting somewhere! It created a drop down but for some reason it's just white. I've attached some images. One other thing would be it's seems like it needs some more space at the bottom if you understand what I mean? Any help sorting these two out would be amazing!! Thanks again for all the help so far.

261094092_302832701709009_4218615620814784862_n.jpg

259334486_629561598226973_5337659425444296702_n.jpg

Link to comment
On 11/29/2021 at 8:07 AM, elzzzzer said:

Hey tuanphan,

Thanks! This code seems to be getting somewhere! It created a drop down but for some reason it's just white. I've attached some images. One other thing would be it's seems like it needs some more space at the bottom if you understand what I mean? Any help sorting these two out would be amazing!! Thanks again for all the help so far.

261094092_302832701709009_4218615620814784862_n.jpg

259334486_629561598226973_5337659425444296702_n.jpg

In the code, you will see this, remove background-color: white; or change white to another color

#t-menu {
        position: absolute;
    top: 35px;
    z-index: 1;
    background: white;

    display: none;
    right: 0;
    text-align: right;
    
    }

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 year later...

Hello! Would anyone be able to help me with this code? im very happy with how it looks on my site but hoping i can change the size/ how the category names look. Is there a way to make the categories a smaller font? "custom bundles" for example is one category, "handmade crochet" etc.  so having it look more uniform would be helpful. Thanks in advance

 

 

image.thumb.png.44601e822ca7dcd062e3f0e633ce5731.png

Link to comment
On 7/26/2023 at 9:37 AM, ashbash18 said:

Hello! Would anyone be able to help me with this code? im very happy with how it looks on my site but hoping i can change the size/ how the category names look. Is there a way to make the categories a smaller font? "custom bundles" for example is one category, "handmade crochet" etc.  so having it look more uniform would be helpful. Thanks in advance

 

 

image.thumb.png.44601e822ca7dcd062e3f0e633ce5731.png

What is site url?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 2 weeks later...
On 8/5/2023 at 12:02 AM, ashbash18 said:

alwaysdopeclothing.com

 

Find this code

.t-item {
        display: block;
        padding-left: 15px;
    }

change it to

.t-item {
        display: block;
        padding-left: 15px;
		font-size: 12px !important;
    }

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

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.