为jquery滑块添加自定义文本而不是数字.ResponiveSlides.js v1.53

时间:2013-03-16 15:19:42

标签: jquery

我尝试为每张幻灯片添加自定义文字,而不是使用项目符号。我试图将样式分配给名称。

我正在使用ResponsiveSlides.js v1.53 https://github.com/viljamis/ResponsiveSlides.js/blob/master/README.md

这是滑块和寻呼机功能中的任何想法吗?

和脚本:

<script>
 $(".rslides").responsiveSlides({
  auto: true,             // Boolean: Animate automatically, true or false
  speed: 500,            // Integer: Speed of the transition, in milliseconds
  timeout: 4000,          // Integer: Time between slide transitions, in milliseconds
  pager: true,           // Boolean: Show pager, true or false
  nav: false,             // Boolean: Show navigation, true or false
  random: false,          // Boolean: Randomize the order of the slides, true or false
  pause: true,           // Boolean: Pause on hover, true or false
  pauseControls: true,    // Boolean: Pause when hovering controls, true or false
  prevText: "Previous",   // String: Text for the "previous" button
  nextText: "Next",       // String: Text for the "next" button
  maxwidth: "",           // Integer: Max-width of the slideshow, in pixels
  navContainer: "",       // Selector: Where controls should be appended to, default is after the 'ul'
  manualControls: "",     // Selector: Declare custom pager navigation
  namespace: "rslides",   // String: Change the default namespace used
  before: function(){},   // Function: Before callback
  after: function(){}     // Function: After callback
});
</script>

我正在处理你的网站会注意到滑块下方的寻呼机。忘记ACF错误。

http://mrblind.dev/aluminium-blinds/

1 个答案:

答案 0 :(得分:0)

每个数字都在.rslides_tab类中,并且包含以rslides1_开头的类的锚标记。因此,您可以使用.each()更改所有数字的文本,例如:

var i=0;
var arr = [ "one", "two", "three", "four", "five" ];
$(".rslides_tabs a[class^='rslides1_']").each(function(){
 $(this).text(arr[i]);
 i++;
});