// javascript document function h$(i) {return document.getelementbyid(i)} function h$$(c, p) {return p.getelementsbytagname(c)} var slider = function () { function init (o) { this.id = o.id; this.at = o.auto ? o.auto : 3; this.o = 0; this.pos(); } init.prototype = { pos : function () { clearinterval(this.__b); this.o = 0; var el = h$(this.id), li = h$$('li', el), l = li.length; var _t = li[l-1].offsetheight; var cl = li[l-1].clonenode(true); cl.style.opacity = 0; cl.style.filter = 'alpha(opacity=0)'; el.insertbefore(cl, el.firstchild); el.style.top = -_t + 'px'; this.anim(); }, anim : function () { var _this = this; this.__a = setinterval(function(){_this.animh()}, 20); }, animh : function () { var _t = parseint(h$(this.id).style.top), _this = this; if (_t >= -1) { clearinterval(this.__a); h$(this.id).style.top = 0; var list = h$$('li',h$(this.id)); h$(this.id).removechild(list[list.length-1]); this.__c = setinterval(function(){_this.animo()}, 20); //this.auto(); }else { var __t = math.abs(_t) - math.ceil(math.abs(_t)*.07); h$(this.id).style.top = -__t + 'px'; } }, animo : function () { this.o += 2; if (this.o == 100) { clearinterval(this.__c); h$$('li',h$(this.id))[0].style.opacity = 1; h$$('li',h$(this.id))[0].style.filter = 'alpha(opacity=100)'; this.auto(); }else { h$$('li',h$(this.id))[0].style.opacity = this.o/100; h$$('li',h$(this.id))[0].style.filter = 'alpha(opacity='+this.o+')'; } }, auto : function () { var _this = this; this.__b = setinterval(function(){_this.pos()}, this.at*1000); } } return init; }(); //һ���ز����ղ������www.16sucai.com