Does anyone know how to make AnythingSlider use the .cur class when using static links to jump betwee开发者_如何学编程n slides?
I've got my the slider working great with the static links, but I'd like to highlight the current active link.
Cheers
Stephen MeehanThis is the solution I came up with. My tags have id's like 'slide-jump1' so I created a new variable called currentPageNow that creates a selector based that combines #slid-jump with the variable base.currentPage. I then add the 'cur' class based on that variable and remove it from the current one. You'll need to add class='cur' to your initial link to begin with. Hope this helps, sorry it's a bit disorganized but I'm in a hurry today.
base.setCurrentPage = function(page, move){
// Only change left if move does not equal false
if(move !== false) base.$wrapper.scrollLeft(base.singleWidth * page);
// Update local variable
base.currentPage = page;
$('#SliderNav a.cur').removeClass('cur');
var currentPageNow = '#slide-jump' + base.currentPage;
$(currentPageNow).addClass('cur');
};
精彩评论