您的問題並不在discs.click但changeSlide()。
有了這個編輯它將工作:
function changeSlide()
{
slideAnimating = true;
console.log("slide out => " + slideNumber);
console.log("slide IN => " + nextSlide + "\n");
currentDisk = nextSlide; // Edit #1
TweenMax.to(discs.eq(slideNumber), 1, {backgroundColor:"#ffffff", borderColor:"#f10000"});
TweenMax.to(slides[slideNumber], duration,
{
left:"-100%",
onComplete:function()
{
slideAnimating = false;
timerFunction.restart(true);
if(wrapper.hasClass("mouse-over"))
{
timerFunction.pause();
}
TweenMax.set(this.target, {left:"100%"});
}
});
TweenMax.fromTo(discs.eq(currentDisk), 1, {backgroundColor:"#ffffff", borderColor:"#f10000"}, {backgroundColor:"#f10000", borderColor:"#ffffff"});
TweenMax.to(slides[nextSlide], duration,
{
left:"0%"
});
if(nextSlide < totalSlides -1)
{
slideNumber = nextSlide;
nextSlide++;
}
else
{
slideNumber = nextSlide;
nextSlide = 0;
console.log("first slide!!");
}
}
(OT)你意識到這種壓痕,使靈魂充滿了痛苦? – 2014-10-06 18:47:54