|
onSlideChangeEnd: function(swiper){
for(i = 0; i < swiper.slides.length; i++){
if(i == 4 && i == swiper.activeIndex){
var elements = swiper.slides[swiper.activeIndex].querySelectorAll("[id^='top-arrow']");
for(a = 0; a < elements.length; a++){
if(elements[a].attributes["style"]){
var temp = elements[a].attributes["style"].value;
temp = temp.replace(/display\s*:\s*[a-z]*\s*;/i, "");
temp = temp + "display:none;";
elements[a].setAttribute("style", temp);
}else{
elements[a].setAttribute("style", temp);
}
}
}else{
var elements = swiper.slides[i].querySelectorAll("[id^='top-arrow']");
for(a = 0; a < elements.length; a++){
if(elements[a].attributes["style"]){
var temp = elements[a].attributes["style"].value;
temp = temp.replace(/display\s*:\s*[a-z]*\s*;/i, "");
if(temp != ""){
elements[a].setAttribute("style", temp);
}else{
elements[a].removeAttribute("style");
}
}
}
}
}
} |
|