FROM CACHE - en_header

i want to add smooth scroll effect to entire website - brooklyn theme

7kingodmsla
Trailblazer
222 0 39

hello everyone i would like to add smooth scroll to my website 

 

web url https://7kingdomsbar.myshopify.com/

password : godgod291

 

thank you please reach out 

Replies 3 (3)
dmwwebartisan
Shopify Partner
11154 2395 3435

@7kingodmsla 

The basic smooth scroll with anchors would work as shown below - since Jumpstart has jQuery I used that for brevity. Also, see my Codepen for a demo.

$(document).ready(function() {
  $('.smooth-scroll').on('click', function(evt) {
    evt.preventDefault();
    $('html, body').animate(
      { scrollTop: $($(this).attr('href')).offset().top},
      300
    );
  });
});

Where you put that in your theme and what elements you decide to smooth scroll is up to you.

 

Best wishes!

If helpful then please Like and Accept Solution | Email: dmw.webartisan@gmail.com | Instagram: @dmw.webartisan
Check here PageFly App to customize your pages | Click here GemPages The most powerful Shopify page builder.
7kingodmsla
Trailblazer
222 0 39

@dmwwebartisan how can i add this to my entire website ? 

dmwwebartisan
Shopify Partner
11154 2395 3435

@7kingodmsla 

Please check this link https://www.minervaknows.com/how-to/how-to-add-a-smooth-scroll-effect-on-shopify-may-sotre-2-myshopi...

If helpful then please Like and Accept Solution | Email: dmw.webartisan@gmail.com | Instagram: @dmw.webartisan
Check here PageFly App to customize your pages | Click here GemPages The most powerful Shopify page builder.