我试图让光滑的旋转木马在我的网站上工作,但它无法正常工作。该网站是https://www.joonganginsurance.com。你可以在那里看到失败的旋转木马
标记看起来像这样:
<div class="slick">
<div>your content</div>
<div>your content</div>
<div>your content</div>
<div>your content</div>
</div>
标题内容如下所示:
<script type="text/javascript" src="/s/slick.js"></script>
<script>
$(document).ready(function(){
$('.slick').slick({
infinite: true,
slidesToShow: 2,
slidesToScroll: 2
});
});
</script>
<style>
/* Slider */
.slick-slider { position: relative; display: block; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -ms-touch-action: none; touch-action: none; -webkit-tap-highlight-color: transparent; }
.slick-list { position: relative; overflow: hidden; display: block; margin: 0; padding: 0; }
.slick-list:focus { outline: none; }
.slick-loading .slick-list { background: white url('//cdn.jsdelivr.net/jquery.slick/1.3.6/ajax-loader.gif') center center no-repeat; }
.slick-list.dragging { cursor: pointer; cursor: hand; }
.slick-slider .slick-list, .slick-track, .slick-slide, .slick-slide img { -webkit-transform: translate3d(0, 0, 0); -moz-transform: translate3d(0, 0, 0); -ms-transform: translate3d(0, 0, 0); -o-transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0); }
.slick-track { position: relative; left: 0; top: 0; display: block; zoom: 1; }
.slick-track:before, .slick-track:after { content: ""; display: table; }
.slick-track:after { clear: both; }
.slick-loading .slick-track { visibility: hidden; }
.slick-slide { float: left; height: 100%; min-height: 1px; display: none; }
.slick-slide img { display: block; }
.slick-slide.slick-loading img { display: none; }
.slick-slide.dragging img { pointer-events: none; }
.slick-initialized .slick-slide { display: block; }
.slick-loading .slick-slide { visibility: hidden; }
.slick-vertical .slick-slide { display: block; height: auto; border: 1px solid transparent; }
/* Icons */
@font-face { font-family: "slick"; src: url('//cdn.jsdelivr.net/jquery.slick/1.3.6/fonts/slick.eot'); src: url('//cdn.jsdelivr.net/jquery.slick/1.3.6/fonts/slick.eot?#iefix') format("embedded-opentype"), url('//cdn.jsdelivr.net/jquery.slick/1.3.6/fonts/slick.woff') format("woff"), url('//cdn.jsdelivr.net/jquery.slick/1.3.6/fonts/slick.ttf') format("truetype"), url('//cdn.jsdelivr.net/jquery.slick/1.3.6/fonts/slick.svg#slick') format("svg"); font-weight: normal; font-style: normal; }
/* Arrows */
.slick-prev, .slick-next { position: absolute; display: block; height: 20px; width: 20px; line-height: 0; font-size: 0; cursor: pointer; background: transparent; color: transparent; top: 50%; margin-top: -10px; padding: 0; border: none; outline: none; }
.slick-prev:focus, .slick-next:focus { outline: none; }
.slick-prev.slick-disabled:before, .slick-next.slick-disabled:before { opacity: 0.25; }
.slick-prev:before, .slick-next:before { font-family: "slick"; font-size: 20px; line-height: 1; color: white; opacity: 0.85; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.slick-prev { left: -25px; }
.slick-prev:before { content: "\2190"; }
.slick-next { right: -25px; }
.slick-next:before { content: "\2192"; }
/* Dots */
.slick-slider { margin-bottom: 30px; }
.slick-dots { position: absolute; bottom: -45px; list-style: none; display: block; text-align: center; padding: 0px; width: 100%; }
.slick-dots li { position: relative; display: inline-block; height: 20px; width: 20px; margin: 0px 5px; padding: 0px; cursor: pointer; }
.slick-dots li button { border: 0; background: transparent; display: block; height: 20px; width: 20px; outline: none; line-height: 0; font-size: 0; color: transparent; padding: 5px; cursor: pointer; }
.slick-dots li button:focus { outline: none; }
.slick-dots li button:before { position: absolute; top: 0; left: 0; content: "\2022"; width: 20px; height: 20px; font-family: "slick"; font-size: 6px; line-height: 20px; text-align: center; color: black; opacity: 0.25; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.slick-dots li.slick-active button:before { opacity: 0.75; }
</style>
我从jsdelivr获得Ken提供的光滑css,将字体目录更改为jsdelivr上的字体目录,并在我的squarespace目录中包含js文件(因此是/ s /目录)。
我做错了什么?我有一种奇怪的感觉,Squarespace的模板代码与css冲突,但如果是这样,那是否意味着我不能使用这个轮播?谢谢!