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

javascript上下左右定時滾動插件

核心代碼:
復制代碼 代碼如下:
<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>

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

效果演示:

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

JavaScript技術javascript上下左右定時滾動插件,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 国产精品自产拍2021在线观看 | 亚洲人成综合 | 色老板在线免费 | 七七七久久久久人综合 | 日本大片免a费观看视频+播放器 | 久青草国产手机在线视频 | 91欧美精品| 亚洲吊丝网 | 日韩精品国产自在久久现线拍 | 亚洲欧美94色 | 日本一区二区高清免费不卡 | 精品久久久久久久久久久久久久久 | 国产在热线精品视频国产一二 | 激情小说激情视频激情图片 | 精品一区精品二区 | 涩涩网址| 久久成人永久免费播放 | 亚洲人欧洲日韩 | 朝鲜美女免费一级毛片 | 韩国三级日本三级美三级 | 狠久久| 一个人免费播放在线视频看片 | 欧美成人免费一区在线播放 | 91视频聊天网 | 精品久久久久久久久久 | 精品国产一区二区三区在线 | 欧美成人午夜视频 | 乱码一区二区三区完整视频 | 91久久免费视频 | 亚洲国产一区二区三区最新 | 亚洲伊人成人 | 国产成人亚洲精品91专区手机 | 在线观看91精品国产剧情免费 | 亚洲线精品久久一区二区三区 | 国产成人宗合 | 欧美xxxx色视频在线观看免费 | 日本高清中文字幕一区二区三区a | 国产人成精品 | 国产一级一级一级成人毛片 | 1区2区3区4区 | 亚洲欧美国产日产综合不卡 |