一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

javascript上下左右定時(shí)滾動插件

核心代碼:
復(fù)制代碼 代碼如下:
<script type="text/Javascript">
function Marquee() {
this.ID = document.getElementById(arguments[0]);
this.Direction = arguments[1];
this.Step = arguments[2];
this.Width = arguments[3];
this.Height = arguments[4];
this.Timer = arguments[5];
this.WaitTime = arguments[6];
this.StopTime = arguments[7];
if (arguments[8]) { this.ScrollStep = arguments[8]; } else { this.ScrollStep = this.Direction > 1 ? this.Width : this.Height; }
this.CTL = this.StartID = this.Stop = this.MouseOver = 0;
this.ID.style.overflowX = this.ID.style.overflowY = "hidden";
this.ID.noWrap = true;
this.ID.style.width = this.Width;
this.ID.style.height = this.Height;
this.ClientScroll = this.Direction > 1 ? this.ID.scrollWidth : this.ID.scrollHeight;
this.ID.innerHTML += this.ID.innerHTML;
this.Start(this, this.Timer, this.WaitTime, this.StopTime);
}
Marquee.prototype.Start = function(msobj, timer, waittime, stoptime) {
msobj.StartID = function() { msobj.Scroll(); }
msobj.Continue = function() {
if (msobj.MouseOver == 1) { setTimeout(msobj.Continue, waittime); }
else { clearInterval(msobj.TimerID); msobj.CTL = msobj.Stop = 0; msobj.TimerID = setInterval(msobj.StartID, timer); }
}
msobj.Pause = function() { msobj.Stop = 1; clearInterval(msobj.TimerID); setTimeout(msobj.Continue, waittime); }
msobj.Begin = function() {
msobj.TimerID = setInterval(msobj.StartID, timer);
msobj.ID.onmouseover = function() { msobj.MouseOver = 1; clearInterval(msobj.TimerID); }
msobj.ID.onmouseout = function() { msobj.MouseOver = 0; if (msobj.Stop == 0) { clearInterval(msobj.TimerID); msobj.TimerID = setInterval(msobj.StartID, timer); } }
}
setTimeout(msobj.Begin, stoptime);
}
Marquee.prototype.Scroll = function() {
switch (this.Direction) {
case 0:
this.CTL += this.Step;
if (this.CTL >= this.ScrollStep && this.WaitTime > 0) { this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL; this.Pause(); return; }
else { if (this.ID.scrollTop >= this.ClientScroll) this.ID.scrollTop -= this.ClientScroll; this.ID.scrollTop += this.Step; }
break;
case 1:
this.CTL += this.Step;
if (this.CTL >= this.ScrollStep && this.WaitTime > 0) { this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL; this.Pause(); return; }
else { if (this.ID.scrollTop <= 0) this.ID.scrollTop += this.ClientScroll; this.ID.scrollTop -= this.Step; }
break;
case 2:
this.CTL += this.Step;
if (this.CTL >= this.ScrollStep && this.WaitTime > 0) { this.ID.scrollLeft += this.ScrollStep + this.Step - this.CTL; this.Pause(); return; }
else { if (this.ID.scrollLeft >= this.ClientScroll) this.ID.scrollLeft -= this.ClientScroll; this.ID.scrollLeft += this.Step; }
break;
case 3:
this.CTL += this.Step;
if (this.CTL >= this.ScrollStep && this.WaitTime > 0) { this.ID.scrollLeft -= this.ScrollStep + this.Step - this.CTL; this.Pause(); return; }
else { if (this.ID.scrollLeft <= 0) this.ID.scrollLeft += this.ClientScroll; this.ID.scrollLeft -= this.Step; }
break;
}
}
</script>

控制使用代碼:
復(fù)制代碼 代碼如下:
<script type="text/Javascript">
<!--
window.onload = function() {
new Marquee(
"s1", //容器ID
0, //向上滾動(0向上 1向下 2向左 3向右)
2, //滾動的步長
251, //容器可視寬度
520, //容器可視高度
50, //定時(shí)器 數(shù)值越小,滾動的速度越快(1000=1秒,建議不小于20)
2000, //間歇停頓時(shí)間(0為不停頓,1000=1秒)
3000, //開始時(shí)的等待時(shí)間(0為不等待,1000=1秒)
75 //間歇滾動間距(可選),可理解為行高,我這里是3*25=75,就是每次滾動三行
);
};
-->
</script>

效果演示:

[Ctrl+A 全選 注:如需引入外部Js需刷新才能執(zhí)行]

JavaScript技術(shù)javascript上下左右定時(shí)滾動插件,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 久久婷婷激情 | 国产一区高清视频 | 欧美三级网址 | 99精品福利视频 | 黄网站色成年片大免费软件 | 国产三级精品美女三级 | 亚洲黄色免费观看 | 久久国产视频网站 | 精品国产第一国产综合精品 | 国产精品999 | 午夜小视频免费 | 看全色黄大色大片免费久久 | 五月婷婷之婷婷 | 久久精品国产91久久麻豆自制 | 色播视频在线观看 | 香蕉视频成人在线观看 | 亚洲欧美一级视频 | 久久精品国产精品亚洲婷婷 | 亚洲欧美日韩国产色另类 | 欧美在线观看www | 色香影院| 国产综合变态自虐重口另类 | 中文字幕佐山爱一区二区免费 | 一区卡二区卡三区卡视频 | 国产精品第二页 | 午夜免费视频网站 | www.久久99| 亚洲人成一区二区三区 | 精品国产自在现线看 | 国产一级精品高清一级毛片 | 干在线视频 | 免费成人福利视频 | 一本色道久久综合狠狠躁 | www.黄色大片 | 激情文学激情图片 | 中文字幕日韩欧美一区二区三区 | 伊人久久久久久久久久 | 亚洲人的天堂男人爽爽爽 | 91在线播放免费不卡无毒 | 久青草国产手机在线视频 | 国产美女精品 |