這裏是我的代碼/例如:http://jsfiddle.net/6j4cT/14/自定義jquery滑塊|點擊菜單項更改Silde
滑塊完美的作品,現在都後,我是如果你點擊任何「新聞項」中說的「節點1 「例如相應的圖像將呈現 - 同爲‘節點2’
// News Article Slideshow
var periodToChangeSlide = 5000;
var pp_slideshow = undefined;
var currentPage = 0;
$('#news-feature-img-wrap li').css('display','list-item').slice(1).css('display','none');
$('#news-items li:first').addClass('active');
$("#news-feature-wrap #news-items li").click(function() {
$(this).parent().addClass('active');
$(this).parent().siblings().removeClass('active');
var index = $(this).parent().index();
var toShow = $("#news-feature-wrap #news-feature-img-wrap li").eq(index);
toShow.show();
toShow.siblings().hide();
currentPage = index;
$.stopSlideshow();
});
$.startSlideshow = function(){
if(typeof pp_slideshow == 'undefined'){
pp_slideshow = setInterval($.startSlideshow, periodToChangeSlide);
} else {
$.changePage();
}
}
$.stopSlideshow = function(){
clearInterval(pp_slideshow);
pp_slideshow= undefined;
}
$.changePage = function(){
var numSlides= $('#news-feature-wrap #news-feature-img-wrap li').length;
currentPage = (currentPage + 1) % numSlides;
var menu = $('#news-feature-wrap #news-items li').eq(currentPage);
menu.addClass('active');
menu.siblings().removeClass('active');
var toShow = $("#news-feature-wrap #news-feature-img-wrap li").eq(currentPage);
toShow.show();
toShow.siblings().hide();
}
$.startSlideshow();
什麼........ ??? – Prashobh 2012-07-31 02:28:52
@prash什麼? ... – Filth 2012-07-31 02:29:42
問題不清楚。 – Prashobh 2012-07-31 02:32:01