Search code examples
javascriptsliderzurb-foundationorbit

Zurb Foundation Orbit slider customization


I'm using the orbit slider and I need to call a function where image timer start. I'm using foundation 3.x

I tried in side shift: function (direction) function but the problem is this that it dose not trigger fist time( I think that init function dose it for the first time)

My purpose is to move another slider (written by me) move in front of the orbit for very strict requirement(but all I need to know is the above mention point)

I'll be on your debt if you could guide me in anyway


Solution

  • To trigger your function when the timer starts the first time, place your call within the startClock() function, look around line 275 in jquery.foundation.orbit.js (Orbit 1.4.0 in Foundation Build 3.5.2):

    startClock: function () {
    
        yourFunctionCallHere();
    
        var self = this;
    

    Additionally, to repeatedly call your function on subsequent slides, place another call within the shift function, look around line 512:

    shift: function (direction) {
    
          yourFunctionCallHere();       
    
           var slideDirection = direction;