javascriptjqueryjquery-scrollable

jQuery scrollable question


I am wondering how I can fade out a div box before scrollable starts and fade it in after the animation stops? Because for me it looks like I start scrollable and then it runs in background and looks for events.

Is there a function like onBeforeStart() or similar?

Greets Max


Solution

  • $('#element').fadeOut('slow', function(){
    //start scrollable and fadein here
    })
    

    by doing this, Scrollable starts only after fadeout is complete.

    UPDATE

    Using scrollable from jQuery tools, you can use the events onBeforeSeek and onSeek to fire an action before scroller starts or after it completes. You can read more about the events in the documentation at http://flowplayer.org/tools/scrollable/index.html.

    To run a function after scrolling has completed, you do something like this

    $("#element").scrollable({
        onSeek: function(event, i) {
             //Whatever goes here         
        }
    })