26 Implements: [Options],
31 initialize:
function(wrapper, ctrl_begin, options) {
32 this.setOptions(options);
33 this.wrapper = $(wrapper);
35 this.slides = this.wrapper.getChildren();
36 this.slides[this.current].addClass(
'active');
37 this.ctrls = $$(
'div[id^=' + ctrl_begin +
']');
38 this.ctrls[this.current].addClass(
'on');
39 if(this.options.auto_start) {
40 this.timeout = setTimeout(this.autoSet.bind(
this), this.options.auto_interval);
45 set:
function(index) {
47 if(this.options.auto_start) {
48 clearTimeout(this.timeout);
54 var myfx =
new Fx.Tween(this.slides[this.current], {
'property':
'opacity'});
55 current_zindex = this.slides[this.current].getStyle(
'z-index');
56 this.slides[this.current].setStyle(
'z-index', current_zindex.toInt() + 1);
57 this.slides[index].setStyle(
'z-index', current_zindex);
59 myfx.start(1,0).chain(
function() {
60 if(this.slides.length > 1) {
61 this.slides[this.current].setStyle(
'z-index', current_zindex.toInt() - 1);
64 this.slides[this.current].removeClass(
'active');
65 this.slides[index].addClass(
'active');
71 var current = this.current;
75 while(i < Math.abs(index - next)) {
77 next = index > current ? next + 1 : next - 1;
81 setTimeout(
function() {
self.setCtrl(n, c) }, 100 * (Math.abs(n-current) - 1));
86 if(this.options.auto_start) {
87 this.timeout = setTimeout(this.autoSet.bind(
this), this.options.auto_interval);
91 setCtrl:
function(next, current) {
94 this.ctrls[current].removeClass(
'on');
95 this.ctrls[current].addClass(next > current ?
'fwd' :
'rwd');
98 this.ctrls[next].addClass(
'on');
101 for(var i = next + 1; i < this.ctrls.length; i++) {
102 this.ctrls[i].removeClass(
'fwd');
103 this.ctrls[i].addClass(
'rwd');
105 for(var i = next - 1; i >= 0; i--) {
106 this.ctrls[i].removeClass(
'rwd');
107 this.ctrls[i].addClass(
'fwd');
111 if(next == this.current) {
119 autoSet:
function() {
120 if(this.current >= this.slides.length - 1) {
124 var index = this.current + 1;
var NewSlider
Costruttore della classe Slider utilizzata dalla vista showcase.