Jump to content

Changing navigation on mobile version

Go to solution Solved by Beyondspace,

Recommended Posts

https://www.anastasiawessex.com/greeting-cards/p/dominick-the-donkey

 

I've used the following CSS to be able to navigate back to the shop category page for all my product pages:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
   jQuery(document).ready(function($) { 
   $('<a href="/shop" class="back-to"> ← back to shop home</a>').insertBefore("nav.ProductItem-nav") 
     ;
 }); 
</script>

On my desktop it's show on the left side of the page which I'd like to keep. However on mobile version I'd like the ' <- back to shop home ' to show on the right side as the rest of the text is on the right. I can't seem to figure out how to do this. I've attached one of the products to show as an example. It would be great if someone could help me out with this, thank you!

desktop.jpg

mobile.jpg

Edited by asimplehomelife
Link to comment
  • Solution
3 hours ago, asimplehomelife said:

https://www.anastasiawessex.com/greeting-cards/p/dominick-the-donkey

 

I've used the following CSS to be able to navigate back to the shop category page for all my product pages:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
   jQuery(document).ready(function($) { 
   $('<a href="/shop" class="back-to"> ← back to shop home</a>').insertBefore("nav.ProductItem-nav") 
     ;
 }); 
</script>

On my desktop it's show on the left side of the page which I'd like to keep. However on mobile version I'd like the ' <- back to shop home ' to show on the right side as the rest of the text is on the right. I can't seem to figure out how to do this. I've attached one of the products to show as an example. It would be great if someone could help me out with this, thank you!

desktop.jpg

mobile.jpg

Try adding to Home > Design > Custom Css

@media only screen and (max-width: 767px){
  .back-to {
    display: block;
    text-align: right;
  }
}

Support me by pressing 👍  or marking as solution if this useful for you

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. Thank you

Link to comment

My testing

image.thumb.png.ef6acaca38fcb7c806a4417b1244b9ea.png

Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.
Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword Highlighter
If you find my answer fit your need, let's leave a like or upvote so others with the same issue can find their solution. 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.