3

The Orbit slider in Foundation 3 is infinite, meaning it cycles through its slides over and over.

Is there a way to get it to display all its slides only once, stopping on the last slide?

Steve
  • 12,696
  • 26
  • 104
  • 191

2 Answers2

1

There is a method provided (which is actually present in the docs @cuberoot referenced), here's the initialization code:

$(window).load(function(){
    $("#featured").orbit({
       singleCycle: true // cycles through orbit slides only once
    });
});
danwild
  • 1,563
  • 1
  • 21
  • 28
  • 1
    anyone know how to do this for Foundation 4? – kateray Mar 12 '13 at 23:03
  • Unless I'm blind, it's been removed as a built-in function. You perhaps want to mod the goto function (around line 295). I've got as far as checking to see if you have reached the final slide, but still need to find correct call to stop slides without prev/next arrows breaking: `var current_slide = (active_index+1) % $slides.length; var slide_count = slides.length - 2; if(current_slide > slide_count){ // call to pause slides here }` – danwild Mar 13 '13 at 11:00
0

I would register a function with afterSlideChange that checks if it is the last slide and then calls orbit.stopClock()

groodt
  • 1,795
  • 14
  • 26
  • Thanks. Is there a listing anywhere of Orbit's methods? – Steve Feb 19 '13 at 21:39
  • I didn't spot much more than afterSlideChange in their documentation, but you can look at the source code: https://github.com/zurb/foundation/blob/master/vendor/assets/javascripts/foundation/jquery.foundation.orbit.js – groodt Feb 19 '13 at 21:52