2014-04-02 22 views
0

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

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

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

此设置应该停止动画,我只希望它滑动每次点击。但它没有做一件事。尽管如此,更改默认设置还是可以的。

有没有人有想法如何解决这个问题?

回答

0

您正在使用错误的选项。 “暂停”在滑块中具有不同的含义。 自动选项定义滑块是否自动运行。

$(".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/

+0

你能解释这一点考虑? – Stefan