I want to add some custom animation when the thumbnails scroll. From example when the user clicks on the next button I want for the thumbnails that leave the screen to Fade out and the thumbnails that appear on the screen Fade In.
From the examples I know that this is the function to use:
onBefore: function( data ) {}
Here is a Demo without the custom animations.
Here I manage to animate Fade and Size but there is a bug yet. The images to not come back to visible.
var defaultCss = {
opacity: 0,
width: 0,
height: 0
};
var selectedCss = {
opacity: 1,
width: "77px",
height: "77px"
};
var scroolItems = 6;
scroll: {
items: scroolItems ,
duration: 1000,
onBefore: function( data ) {
data.items.old.find('img').animate(defaultCss);
data.items.visible.eq(scroolItems ).find('img').animate(selectedCss);
}
}