平滑滚动 - CSS 技巧 - 不起作用

Smooth Scrolling - CSS Tricks - Not Working

我刚刚在我的 shopify 商店网站中实施了 Smooth Scrolling by CSS Tricks 的脚本。但它对我不起作用:(

这是平滑滚动的脚本

<script>
 jQuery(function($) {
     $j('a[href*="#"]:not([href="#"])').click(function() {
      if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
        var target = $j(this.hash);
        target = target.length ? target : $j('[name=' + this.hash.slice(1) +']');
        if (target.length) {
          $j('html, body').animate({
            scrollTop: target.offset().top
          }, 1000);
          return false;
        }
      }
    });
   });
 </script> 

这是我的光滑滑块的另一个代码

<script>
 jQuery(function($) {
      $j('.obs_store_wall_slider').slick({
        dots: true,
        infinite: true,
        speed: 500,
        fade: true,
        draggable: false,
        arrows: true,
        autoplay: true,
        autoplaySpeed: 5000,
        pauseOnHover: true,
        cssEase: 'linear'
      });

    $j('.obs_store_wall_banner_slider').slick({
        dots: false,
        infinite: true,
        speed: 500,
        draggable: true,
        arrows: true,
        autoplay: true,
        autoplaySpeed: 5000,
        pauseOnHover: true,
        cssEase: 'linear'
      });
   });
 </script> 

要观看现场表演,请访问 my store

哇,我简直不敢相信。由于我的 html 语法,脚本无法正常工作,我在部分 ID 中放置了一个“#”:D