1 window.onload = function () {
2 function Slide() {
3 this.oImgContainer = document.getElementById("img-container");
4 this.aLi = document.getElementsByTagName("li");
5 this.index = 0;
6 }
7
8 Slide.prototype.bind = function () {
9 var that = this;
10 for (var i = 0; i < this.aLi.length; i++) {
11 this.aLi[i].index = i;
12 this.aLi[i].onmouseover = function () {
13 that.moveLeft( this.index );
14 }
15 }
16 }
17
18 Slide.prototype.moveLeft = function (i) {
19 this.index = i;
20 for( var j = 0; j < this.aLi.length; j++ ){
21 this.aLi[j].className = '';
22 }
23 this.aLi[this.index].className = 'active';
24 animate( this.oImgContainer, {
25 "left" : -this.index * 800
26 });
27 }
28
29 var oSlide = new Slide();
30 oSlide.bind();
31
32 }