*/
; $(function ($,window,document,undefined)
{
Slider = function (container,options)
{
/*
auto: true,
time: 3000,
event: ‘hover‘ | ‘click‘,
mode: ‘slide | fade‘,
controller: $(),
activeControllerCls: ‘className‘,
exchangeEnd: $.noop
}
*/
"use
Strict"; //
Strict mode not support by IE9-
if (!container) return;
var options = options ||
{},
cls = option
s.activeControllerCls,
controller = option
s.controller,
interval,
slidesWrapper = container.children().first(),
slides = slidesWrapper.children(),
childWidth = container.width(),
@R_689_1
0586@lWidth = childWidth * slide
s.length;
var controlItem = controller.children(
);
event == ‘hover‘ ? controlIte
m.mou
SEOver(function ()
{
var index = $(this).index(
);
play(index,option
s.mod
E);
}).mou
SEOut(function ()
{
}) : controlIte
m.click(function ()
{
var index = $(this).index(
);
play(index,option
s.mod
E);
}
//animate mode
var wrapper = container.children().first(
);
option
s.mode == ‘slide‘ ? wrapper.width(@R_689_1
0586@lWidth) : wrapper.children().css(
{
‘position‘: ‘absolute‘,
‘left‘: 0,
‘top‘: 0
})
.first().siblings().hide(
);
}
//auto play
interval = se
Tinterval(function ()
{
}
var index;
(cIndex == length - 1) ? index = 0 : index = cIndex + 1;
play(index,option
s.mod
E);
}
//play
function play(index,mod
E) {
slidesWrapper.stop(true,tru
E);
mode == ‘slide‘ ? (function ()
{
left: ‘-=‘ + Math.abs(index - curren
Tinde
X) * childWidth + ‘px‘
} else if (index < curren
Tinde
X) {
left: ‘+=‘ + Math.abs(index - curren
Tinde
X) * childWidth + ‘px‘
return;
}
if (slidesWrapper.children(‘:visible‘).index() == inde
X) return;
slidesWrapper.children().fadeOut(delay).eq(inde
X).fadeIn(delay
);
controller.children(‘.‘ + cls).removeClass(cls
);
controller.children().eq(inde
X).addClass(cls
);
option
s.exchangeEnd && typeof option
s.exchangeEnd == ‘function‘ && option
s.exchangeEnd.call(this,curren
Tinde
X);
}
//stop
}
//prev frame
}
//next frame
}
alert(‘aaa‘)
}
//init
//expose the Slider API
},
},
stop()
}
}
};