网站首页源代码100例之八十 下载本文

内容发布更新时间 : 2024/11/19 13:22:34星期一 下面是文章的全部内容请认真阅读。

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)'; } }