// 懒人图库 搜集整理 www.lanrentuku.com function getstyle(obj,name) { if(obj.currentstyle) { return obj.currentstyle[name] } else { return getcomputedstyle(obj,false)[name] } } function getbyclass(oparent,nclass) { var ele = oparent.getelementsbytagname('*'); var arrent = []; for(var i=0; i0?math.ceil(speed):math.floor(speed); if(cutt==add) { clearinterval(obj.timer) } else { if(att=='opacity') { obj.style.opacity = (cutt+speed)/100; obj.style.filter = 'alpha(opacity:'+(cutt+speed)+')'; } else { obj.style[att] = cutt+speed+'px'; } } },30) } window.onload = function () { var odiv = document.getelementbyid('playbox'); var opre = getbyclass(odiv, 'pre')[0]; var onext = getbyclass(odiv, 'next')[0]; var oulbig = getbyclass(odiv, 'oulplay')[0]; var abigli = oulbig.getelementsbytagname('li'); var odivsmall = getbyclass(odiv, 'smalltitle')[0] var alismall = odivsmall.getelementsbytagname('li'); function tab() { for (var i = 0; i < alismall.length; i++) { alismall[i].classname = ''; } alismall[now].classname = 'thistitle' startmove(oulbig, 'left', -(now * abigli[0].offsetwidth)) } var now = 0; // alert(alismall.length); for (var i = 0; i < alismall.length; i++) { alismall[i].index = i; alismall[i].onclick = function () { now = this.index; tab(); } } opre.onclick = function () { now-- if (now == -1) { now = abigli.length; } tab(); } onext.onclick = function () { now++ if (now == abigli.length) { now = 0; } tab(); } var timer = setinterval(onext.onclick, 3000) //滚动间隔时间设置 odiv.onmouseover = function () { clearinterval(timer) } odiv.onmouseout = function () { timer = setinterval(onext.onclick, 3000) //滚动间隔时间设置 } }