Flickity 2 - groupCells 和 pageDots 不能同时工作 [英] Flickity 2 - groupCells and pageDots not working at the same time

查看:32
本文介绍了Flickity 2 - groupCells 和 pageDots 不能同时工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 flickity 的新手,我想对单元格进行分组并同时显示点.但在我的项目中,它们似乎是相互排斥的,我可以对单元格进行分组或显示点,即使从这个 codepen,他们合作得很好.

I am new to flickity and I want to group cells and display dots at the same time. But on my project they seems to be mutually exclusive, I can either group cells or display dots, even if from this codepen, they do work well together.

我做错了什么?

这是我的代码

我的页面:

此 html 是我的 angularjs 自定义指令中模板的一部分:

this html is part of the template in my angularjs custom directive:

app.directive('productSlider', function ($rootScope, $compile, $timeout, $sce, $location, $window) {

    return {
        restrict: 'E',
        template: '<section id="products" >' +
            '<div class="prodotti-int gallery js-flickity" id="productSlider" data-flickity=\'{ "groupCells": 4 }\' >' +
            ... +

这是我指令的 link 方法中的 jquery:

here is my jquery inside the link method of my directive:

$('#productSlider.gallery').flickity({
                            // options
                            cellAlign: 'center',
                            freeScroll: true,
                            wrapAround: false,
                            contain: true,
                            autoPlay: 0,
                            prevNextButtons: false,
                            pageDots: false
                        });

在这种情况下,单元格已正确分组,但我看不到点.为了看到这些点,我需要删除 groupCells 属性.

In this case, the cell are grouped properly but I dont see the dots. In order to see the dots, I need to remove the groupCells property.

我做错了什么?

注意:此代码在同一页面内工作.

Note: this code works inside the same page.

谢谢

推荐答案

如果不查看您的代码(至少是一些演示问题的示例),这真的很难提供帮助,但是这里有一个您需要的示例:

Without looking at your code (at least some example that demonstrates the problem) it's really hard to help, however here is an example with what you need:




希望能帮到你.

这篇关于Flickity 2 - groupCells 和 pageDots 不能同时工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆