How to add scroll t...
 
Notifications
Clear all

How to add scroll to top button to my shopify store?

3 Posts
3 Users
0 Reactions
999 Views
ralf15
(@ralf15)
Eminent Member
Joined: 4 years ago
Posts: 27
Topic starter  

Hi,

Ralf here again 😀

I would like to know how can i add a scroll to top button to my shopify store (plak theme)

Thank you


   
Quote
Jasmine Keinsh
(@plakadmin)
Estimable Member Admin
Joined: 4 years ago
Posts: 131
 

Hi @ralf15

Jasmine from Plak support here to assist with adding a Scroll To Top button to Plak theme.

Spoiler
1- Add snippet
  • From Your Shopify dashboard, click Online Store > Actions > Edit code
  • Under Snippets, click Add a new snippet
  • In the box, name the snippet scroll-to-top and click Create snippet
  • Add the code below
<style>
.scrolltop{
display:none;
opacity:0.5;
position:fixed;
bottom:10px;
right:10px;
display: none;
background:#000000;
color:#FFFFFF;
font-size: 1.5em;
text-decoration: none;
padding: 5px 10px 5px 10px;
}
.scrolltop:hover, .scrolltop:focus {
outline: none;
text-decoration: none;
opacity: 1;
}
</style>
<a href="#" class="scrolltop"><i class="fa fa-xs fa-arrow-circle-up"></i></a>
<script>$(document).ready(function(){$(window).scroll(function(){$(this).scrollTop()>100?$(".scrolltop").fadeIn():$(".scrolltop").fadeOut()}),$(".scrolltop").click(function(){return $("html, body").animate({scrollTop:0},500),!1})});</script>
  • Click Save

 

Spoiler
2- Call the snippet
  • Under Layout, click theme.liquid
  • Before the closing </body> add the below code

 

{% if template != 'cart' %} {% include 'scroll-to-top' %} {% endif %}

 

  • Click Save

 

Notes :

 

  • If you have a widget enabled such as Messenger or Whatsapp, you can play with the CSS codes : bottom:60px;right: 10px; in order to position the Scroll To Button above those widgets.
  • This feature is already included by default in Sly theme and will included in the next Plak release (Plak 2.1)

 

If you have any other questions, don't hesitate to contact us again 🙂

Best regards,
Jasmine

Jasmine | Plak theme support
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as a Solved Solution


   
ReplyQuote
(@danielle12)
Active Member
Joined: 4 years ago
Posts: 19
 

i added it to my store as well 🙂 thanks for sharing this great thread 🙂


   
ReplyQuote
Share:

Welcome to the Shopify Forum Community provided by Plak ThemeLLC, a place where you can discuss about eCommerce and Shopify, solve technical issues, get help with Shopify Design, Apps integration, Marketing, Facebooks ad, Google ads and more.

Before posting, we invite you to read and follow the forum rules | We also support any questions related to Free Shopify themes :Dawn, Express, Minimal, Brooklyn, Narrative, Supply, Debut, Venture, Boundless and Simple