我刚刚在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
答案 0 :(得分:0)