需要從滑塊中處於活動狀態的當前幻燈片獲取「數據編號」值。我想使用此值來顯示/隱藏頁面另一個div中的其他信息。或者,如果除了添加特定的「數據編號」值之外還有其他方法,請告訴我 - 我在文檔中沒有看到返回幻燈片編號的內容。responsiveslides.js - 獲取當前幻燈片
我知道我可以使用'後'回調然後做我想要的,但不知道我怎麼能得到這個值的第一個地方。
<div class="row">
<div class="col-md-12">
<ul class="rslides" id="slider1">
<li data-number="1">
<img src="/user-data/2/screenshots/demo21.jpg" alt="">
</li>
<li data-number="2">
<img src="/user-data/2/screenshots/demo22.jpg" alt="">
</li>
<li data-number="3">
<img src="/user-data/2/screenshots/demo23.jpg" alt="">
</li>
<li data-number="4">
<img src="/user-data/2/screenshots/demo24.jpg" alt="">
</li>
<li data-number="5">
<img src="/user-data/2/screenshots/demo25.jpg" alt="">
</li>
</ul>
</div>
</div>
$("#slider1").responsiveSlides({
auto: false, // 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: true, // 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: "centered-btns", // String: Change the default namespace used
before: function(){}, // Function: Before callback
after: function(){} // Function: After callback
});
尼斯 - 謝謝! – user756659