网站首页源代码100例之八十

if (demo2.offsetWidth - demo.scrollLeft <= 0) demo.scrollLeft -= demo1.offsetWidth else

demo.scrollLeft++ }

function Marqueeright() {//向右滚动

if (demo2.offsetWidth - demo.scrollLeft >= 565) demo.scrollLeft += demo1.offsetWidth else

demo.scrollLeft-- }

var MyMar = setInterval(Marqueeleft, speed)//自动开始滚动

Direction = 'Left'; //设定初始方向为向左滚

demo.onmouseover = function () { clearInterval(MyMar) } demo.onmouseout = function () { if (Direction == 'Left') {

MyMar = setInterval(Marqueeleft, speed) } else if (Direction == 'Right') {

MyMar = setInterval(Marqueeright, speed) } };

getElement('left').onclick = function () { clearInterval(MyMar);

MyMar = setInterval(Marqueeleft, speed) Direction = 'Left'; };

getElement('left').onmouseover = function () { this.style.opacity = 0.3;

this.style.filter = 'alpha(opacity=30)'; }

getElement('left').onmouseout = function () { this.style.opacity = 0.05;

this.style.filter = 'alpha(opacity=5)'; }

getElement('right').onclick = function () { clearInterval(MyMar);

MyMar = setInterval(Marqueeright, speed) Direction = 'Right'; };

getElement('right').onmouseover = function () {

this.style.opacity = 0.3;

this.style.filter = 'alpha(opacity=30)'; }

getElement('right').onmouseout = function () { this.style.opacity = 0.05;

this.style.filter = 'alpha(opacity=5)'; } }

联系客服:779662525#qq.com(#替换为@) 苏ICP备20003344号-4