如何更改滑动滑块的分数计数器的分数'/'符号?

问题描述 投票:0回答:1

我想更改滑动滑块的分数计数器的'/'符号。想要将此格式:“ 1/12”更改为“ 1..12”。这是分数计数器的代码:

renderFraction: function (currentClass, totalClass) {
      return '<span class="' + currentClass + '"></span>' +
              ' of' +
              '<span class="' + totalClass + '"></span>';
  },

这是codepen:https://codepen.io/weddje/pen/jObmBWo带有工作滑块的页面:https://nonfiction.photos/flickity-test/

谢谢!

javascript styling swiper
1个回答
0
投票

添加如下的自定义分页方法;

pagination: {
        el: '.swiper-pagination',
        type: 'fraction',
        renderFraction: function (currentClass, totalClass) {
          return '<span class="' + currentClass + '"></span>' +
                  ' .. ' +
                  '<span class="' + totalClass + '"></span>';
        },
      },
© www.soinside.com 2019 - 2024. All rights reserved.