-
Notifications
You must be signed in to change notification settings - Fork 0
/
slider.js
43 lines (37 loc) · 1.32 KB
/
slider.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
window.addEvent('load', function(){
slider = new SlideBox("myList");
slider.addPlugin(new Bullets());
slider.addPlugin(new Arrows());
slider.start();
var animations = [
new FadeAnimation(slider.options),
// new RightFadeAnimation(slider.options),
new RightToLeftAnimation(slider.options),
// new UpAndBottomColumns(slider.options),
// new LeftAndRightRowsAnimation(slider.options),
new FromRightAnimation(slider.options),
new FromLeftAnimation(slider.options),
new FromTopAnimation(slider.options),
new FromBottomAnimation(slider.options),
// new RandomCellFadeOutAnimation(slider.options),
// new RandomCellTransitionAnimation(slider.options)
];
animations.each(function(animation)
{
slider.addAnimation(animation);
addAnimationButtonToIndex(animation);
})
function addAnimationButtonToIndex(animation)
{
var animationName = animation.getName();
var li = new Element('li').inject('animations')
var a = new Element('a',{
href:'#',
text:animationName
}).inject(li);
a.addEvent('click', function(event){
event.preventDefault();
slider.options.animation = animationName;
})
}
})