Home › Forums › JavaScript › [Solved] AnythingSlider & WordPress – the_title(); -> Slidernames › Re: [Solved] AnythingSlider & WordPress – the_title(); -> Slidernames
How about
var totalSlides = $(".thumbNav li").not("arrow").size();
for(var i=0; i <= totalSlides; ++i){
$(".anythingSlider .thumbNav li").not(".cloned").eq(i).children("a")
.text(
$(".anythingSlider .wrapper ul li").eq(i).find("h2").text()
);
}
– Variable totalSlides is the number of .thumbNav li’s that don’t have the class of “arrow”.
– A for loop that is looped the amount of times as there are slides
– Target the thumbNav li’s that don’t have a class of cloned (Anything slider has a cloned first and last slide)
– eq() is the index. Starts on 0. We are planning on matching up the index of the slides with the index of the number.
– Select the child <a> and change it’s text to
– The matched slide (Via index)
– Find the text of the <h2> contained within this List item (Assuming the Title is contained within the h2)
I don’t think there is a native option within anythingSlider to change the text of these paginated numbers.
Note: I have not tested this.