Flickity 2

编程入门 行业动态 更新时间:2024-10-27 06:35:04
本文介绍了Flickity 2 - groupCells 和 pageDots 不能同时工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我是 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屋!

更多推荐

[db:关键词]

本文发布于:2023-04-23 08:34:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1038443.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Flickity

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!