一区二区久久-一区二区三区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上下左右定時滾動插件,轉載需保留來源!

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

主站蜘蛛池模板: 天天欧美| 91精品一区二区三区久久久久 | 欧美成人三级 | 国产成人久视频免费 | 伊人俺去久久涩五月综合 | 精品国精品国产自在久国产不卡 | 四虎网站最新 | 在线视频黄色 | 亚洲国产韩国一区二区 | 亚洲国产成人久久一区www | 色多多成视频人在线观看 | 高清不卡一区二区三区 | 亚洲国产一区二区三区在线观看 | 国产91边对白在线播放 | 国产精品资源手机在线播放 | 国产小视频在线观看免费 | 加勒比色久综合在线 | 九九午夜 | 在线播放亚洲美女视频网站 | 热色视频 | 国产网站免费视频 | 国产精品自在线拍 | 激情婷婷六月 | 亚洲国产成人资源在线软件 | 国产亚洲精品午夜高清影院 | 久久久91精品国产一区二区三区 | 亚洲午夜国产精品无卡 | 色干干 | 欧美成人免费一级人片 | 欧美在线一二三区 | 中文字幕在线精品 | 欧美激情一区二区三区中文字幕 | 婷婷五月在线视频 | 东京加勒比2021一区 | 国产精品亚洲小说专区 | 99热国产免费 | 亚洲综合成人网 | 国产一二三四区在线观看 | 国产日韩欧美一区二区三区综合 | 中国日韩欧美中文日韩欧美色 | 国产一区二区在线视频 |