Materializecss: carousel & slider not working

2019-08-14 13:03发布

EDIT: I found out the solution. See my post at the bottom of the page.

I've created a template for joomla with materializecss. Everything works fine except the slider (which displays as a gray rectangle) and carousel which just shows images one after another as obsolete divs.

The carousel: carousel

The slider: slider

I've imported the jquery script before materializecss. I've also called the carousel.carousel(). The code for slider and carousel I used is same as on the Materializecss website in examples. Can anyone help?

3条回答
我命由我不由天
2楼-- · 2019-08-14 13:47

enter this script

    <script type="text/javascript">
    $(document).ready(function () {
        $('.carousel').carousel();

)}

查看更多
等我变得足够好
3楼-- · 2019-08-14 13:51

Updating materializecss files solved the problem. I also found out that a part of materialize.css was missing.

查看更多
我只想做你的唯一
4楼-- · 2019-08-14 14:07

If you are using NOT default classes for carousel items - you need to change them classes in carousel.js file

查看更多
登录 后发表回答