开发者

Stop/Start Slider - Stop after one cycle

I have a project that I am working on that uses Start/Stop slider by Chris Coyier shown here http://css-tricks.com/startstop-slider. The client loves it, but now wants it to to just cycle through once and stop. Also after it cycles and stops the "Stop" butt开发者_运维技巧on to turn to "Start" so that if the user wants to play it again they can.

I am a newbie at jquery/Javascript and am having no luck figuring this out.

Thank you for your help


You need to update the doMove function and clear the interval after the slide has completed 1 revolution

if (movement == tooFar) {
  $(".slide img").animate({
    "top": -200
  }, function() {
    $("#mover").animate({
      "left": 0
    }, function() {
      $(".slide img").animate({
        "top": 20
      });
    });
  });

  clearInterval(sliderIntervalID);
  $("#slider-stopper").text("Start");
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜