[英]Unslider add .active class to active elements?
I am using JQuery Unslider. 我正在使用JQuery Unslider。 How can I make it add an active
class to the current slider element? 如何使其向当前的滑块元素添加active
类?
http://unslider.com/ http://unslider.com/
I am trying to use this, but it is not working: 我正在尝试使用它,但是它不起作用:
$('#slider').unslider({
delay: 3000,
keys: false,
fluid: true,
dots: false,
complete: function(){
$(this).addClass('active');
},
});
That didnt work for me. 那对我没有用。 I did this on line 187 of unslider.js just make sure you add the class "active" to your fist slide. 我是在unslider.js的第187行上执行此操作的,只是确保将“ active”类添加到第一张幻灯片中。 good permanent fix. 好的永久性修复。
if (o.fade) {
_.i = index;
ul.find("li:visible").fadeOut(speed);
ul.find("li:visible").removeClass('active');
ul.find("li").eq(index).addClass('active');
ul.find("li").eq(index).fadeIn(speed);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.