简体   繁体   English

Slick 轮播缺少 3 个资源。 我如何实现这些?

[英]Missing 3 recources for the Slick carousel. How do I implement those?

In the console it says that I'm missing the slick.woff, ajax-loader.gif and slick.tff.控制台中,它说我缺少 slick.woff、ajax-loader.gif 和 slick.tff。

So I've found the CDN links for all these 3, but I have no idea how to implement them in my code (or in what kind of tag).所以我找到了所有这 3 个的 CDN 链接,但我不知道如何在我的代码中(或在什么样的标签中)实现它们。

https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/ajax-loader.gif https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/ajax-loader.gif

https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/fonts/slick.ttf https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/fonts/slick.ttf

https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/fonts/slick.woff https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.9.0/fonts/slick.woff

The resources you've mentioned that are failing to load are referenced as relative imports in Slick's stylesheets.您提到的未能加载的资源在 Slick 的样式表中被引用为相对导入。

Make sure that you've included these stylesheets (the first code block below) correctly, as per the Slick documentation: 根据 Slick 文档,确保您已正确包含这些样式表(下面的第一个代码块):

Example using jsDelivr使用 jsDelivr 的示例

Just add a link to the css file in your <head> :只需在<head>中添加指向 css 文件的链接:

 <.-- Add the slick-theme.css if you want default styling --> <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/gh/kenwheeler/slick@1.8.1/slick/slick.css"/> <.-- Add the slick-theme.css if you want default styling --> <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/gh/kenwheeler/slick@1.8.1/slick/slick-theme.css"/>

Then, before your closing tag add:然后,在结束标记之前添加:

 <script type="text/javascript" src="//cdn.jsdelivr.net/gh/kenwheeler/slick@1.8.1/slick/slick.min.js"></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM