响应式幻灯片.js - 自动不起作用

responsiveslides.js - auto not working

本文关键字:不起作用 js 幻灯片 响应      更新时间:2023-09-26

我正在使用此脚本将响应式幻灯片添加到一个小网站。我还没有找到一个完美的幻灯片脚本,我怀疑它是否存在。我已经从猫头鹰滑块,通量滑块到jquery基本滑块,现在我已经到达了响应式幻灯片.js(responsiveslides.com/https://github.com/viljamis/ResponsiveSlides.js)

我的问题是,我无法让自动设置工作。这是我触发插件的代码:

$(".rslides_home").responsiveSlides({
    'pause':true
});

此设置应该停止动画,我只希望它每次单击滑动。但它什么也做不了。不过,更改默认设置可以完成这项工作。

有没有人知道如何解决这个问题?

您使用了错误的选项。"暂停"在滑块中具有不同的含义。自动选项定义滑块是否自动播放。

  $(".rslides_home").responsiveSlides({
    auto: false
    });

以下是滑块的定义选项。如您所见,当您希望滑块在悬停时停止时,会使用"暂停"选项。

$(".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: false,           // 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: false,           // 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
});

这些选项取自 http://responsiveslides.com/