87,910
社区成员
发帖
与我相关
我的任务
分享
window.onload=window.onresize=window.onscroll=function () {
var oBox = document.getElementById("divQQbox");
var oLine = document.getElementById("divOnline");
var oMenu = document.getElementById("divMenu");
var iScrollTop = document.documentElement.scrollTop || document.body.scrollTop;
setTimeout(function() {
clearInterval(oBox.timer);
var iTop = parseInt((document.documentElement.clientHeight - oBox.offsetHeight) / 2) + iScrollTop;
oBox.timer = setInterval(function() {
var iSpeed = (iTop - oBox.offsetTop) / 8;
iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed);
oBox.offsetTop == iTop ? clearInterval(oBox.timer) : (oBox.style.top = oBox.offsetTop + iSpeed + "px");
}, 10)
}, 100)
oBox.onmouseover = function() {
this.style.width = 153 + "px";
this.style.height = 348 + "px";
oLine.style.display = "block";
oLine.style.background = "#f5fbff";
oMenu.style.display = "none";
};
oBox.onmouseout = function() {
this.style.width = '';
this.style.height = '';
oLine.style.display = "none";
oMenu.style.display = "block";
};
};
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;
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) //滚动间隔时间设置
}
}
function doit() {
var oBox = document.getElementById("divQQbox");
var oLine = document.getElementById("divOnline");
var oMenu = document.getElementById("divMenu");
var iScrollTop = document.documentElement.scrollTop || document.body.scrollTop;
setTimeout(function() {
clearInterval(oBox.timer);
var iTop = parseInt((document.documentElement.clientHeight - oBox.offsetHeight) / 2) + iScrollTop;
oBox.timer = setInterval(function() {
var iSpeed = (iTop - oBox.offsetTop) / 8;
iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed);
oBox.offsetTop == iTop ? clearInterval(oBox.timer) : (oBox.style.top = oBox.offsetTop + iSpeed + "px");
}, 10)
}, 100)
oBox.onmouseover = function() {
this.style.width = 153 + "px";
this.style.height = 348 + "px";
oLine.style.display = "block";
oLine.style.background = "#f5fbff";
oMenu.style.display = "none";
};
oBox.onmouseout = function() {
this.style.width = '';
this.style.height = '';
oLine.style.display = "none";
oMenu.style.display = "block";
};
};
window.onload = function ()
{
window.onresize=window.onscroll = doit;
doit();
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;
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) //滚动间隔时间设置
}
}