简体   繁体   中英

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.

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).

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.woff

The resources you've mentioned that are failing to load are referenced as relative imports in Slick's stylesheets.

Make sure that you've included these stylesheets (the first code block below) correctly, as per the Slick documentation:

Example using jsDelivr

Just add a link to the css file in your <head> :

 <.-- 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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