Найдите ошибку в коде javascriprt
Egor Aliev

slide = {
class: ".slide-wrap",
active: "",
count: "",
metka: function (){
arr = $(this.class).find(".slide-tarif");
for (var i = 0; i<arr.length;i++){
$(arr[i]).attr("slide",i+1);
}
},
count: function(){
this.count = $(this.class).find("[slide]").length;
},
a_slide: function(){
return $(this.class).find(".active").attr("slide");
},
slider: function(){
var active = this.a_slide;
if(active != this.count){
$(this.class).find("[slide='"+active+"']").removeClass("active")
$(this.class).find("[slide='"+(parseInt(active)+1)+"']").addClass("active")
}else{
$(this.class).find("[slide='"+this.count+"']").removeClass("active")
$(this.class).find("[slide]:first-child").addClass("active")
}
},
processor: function(){
this.
count();
this.metka();
this.replay();
},
replay: function(){
setTimeout(this.slider, 2000);
}
}
slide.processor();

Egor Aliev 5 месяцев назадСпасибо 0
2 чел.