欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時(shí)間:2010年06月19日 16:43:52   作者:  
在網(wǎng)上找到的,我認(rèn)為最為方便的一段定時(shí)滾動(dòng)代碼,找了很多其他的總是有這樣那樣的問(wèn)題,好不容易找到的,就分享一下。
核心代碼:
復(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, //向上滾動(dòng)(0向上 1向下 2向左 3向右)
2, //滾動(dòng)的步長(zhǎng)
251, //容器可視寬度
520, //容器可視高度
50, //定時(shí)器 數(shù)值越小,滾動(dòng)的速度越快(1000=1秒,建議不小于20)
2000, //間歇停頓時(shí)間(0為不停頓,1000=1秒)
3000, //開(kāi)始時(shí)的等待時(shí)間(0為不等待,1000=1秒)
75 //間歇滾動(dòng)間距(可選),可理解為行高,我這里是3*25=75,就是每次滾動(dòng)三行
);
};
-->
</script>

效果演示:

[Ctrl+A 全選 注:引入外部Js需再刷新一下頁(yè)面才能執(zhí)行]

相關(guān)文章

  • js單行消息滾動(dòng)代碼,可添加無(wú)數(shù)個(gè)

    js單行消息滾動(dòng)代碼,可添加無(wú)數(shù)個(gè)

    JavaScript實(shí)現(xiàn)單行新聞滾動(dòng)代碼,可添加無(wú)數(shù)行,只要你有那么多內(nèi)容,我覺(jué)得挺不錯(cuò),發(fā)上來(lái)供大家使用和參考。
    2010-11-11
  • javascript 灑脫飄動(dòng)的文字

    javascript 灑脫飄動(dòng)的文字

    飄動(dòng)的文字,看著還挺自在、灑脫,網(wǎng)上經(jīng)常見(jiàn)的東西,原來(lái)是這么實(shí)現(xiàn)的,奉獻(xiàn)給大家哦。
    2009-10-10
  • JS溶解形式的文字切換特效

    JS溶解形式的文字切換特效

    JavaScript形成溶解過(guò)渡形式的文字切換特效,夠酷吧,的你平靜如水的網(wǎng)頁(yè)上旋轉(zhuǎn)這么一個(gè)文字特效,一定會(huì)吸引不少人的注意力,文字內(nèi)容和顏色以及字號(hào)大小看看代碼就會(huì)知道怎么改了。
    2009-11-11
  • 簡(jiǎn)介內(nèi)容超出部分文字隱藏省略的特效(可顯示)

    簡(jiǎn)介內(nèi)容超出部分文字隱藏省略的特效(可顯示)

    如果字?jǐn)?shù)找過(guò)特定的字符數(shù),那么超過(guò)這個(gè)字符數(shù)后的文字就顯示省略號(hào)... 然后出現(xiàn)【展開(kāi)】或省略號(hào),點(diǎn)擊之后就出現(xiàn)全部?jī)?nèi)容
    2011-10-10
  • 5分鐘教你學(xué)會(huì)超簡(jiǎn)單的html+css魔幻霓虹燈文字特效

    5分鐘教你學(xué)會(huì)超簡(jiǎn)單的html+css魔幻霓虹燈文字特效

    這篇文章5分鐘教你學(xué)會(huì)超簡(jiǎn)單的html+css魔幻霓虹燈文字特效,只用簡(jiǎn)單的html+css就可以完成,不需要配置運(yùn)行環(huán)境,魔幻的霓虹燈特效非常炫酷,一起來(lái)學(xué)習(xí)一下,需要的朋友可以參考下
    2023-03-03
  • 文字在網(wǎng)頁(yè)上下浮動(dòng) 學(xué)習(xí)可以不建議用

    文字在網(wǎng)頁(yè)上下浮動(dòng) 學(xué)習(xí)可以不建議用

    JavaScript控制文字像跳跳球一樣在網(wǎng)頁(yè)上浮動(dòng),碰到邊緣自動(dòng)回來(lái),有興趣看一下。
    2009-11-11
  • 一個(gè)實(shí)現(xiàn)字體大中小方法的JavaScript代碼

    一個(gè)實(shí)現(xiàn)字體大中小方法的JavaScript代碼

    再發(fā)一個(gè)實(shí)現(xiàn)字體大中小方法的JavaScript代碼,這種效果估計(jì)大家在網(wǎng)上見(jiàn)到挺多了,點(diǎn)擊適時(shí)改變網(wǎng)頁(yè)上字體的大小,以適合不同人群的瀏覽體驗(yàn),本代碼較簡(jiǎn)單,使用方便。
    2011-08-08
  • 文字瞬間從左到右切換顯示的JavaScript代碼

    文字瞬間從左到右切換顯示的JavaScript代碼

    Javascript一文字修飾程序,不知如何來(lái)形容,看了比較喜歡,讓一組文字不斷的切換,顯示時(shí)候從左到右瞬間切換完成,但還能讓人感覺(jué)有動(dòng)態(tài)變化的效果,有興趣試一下,直接復(fù)制到你的網(wǎng)頁(yè)上就能用了
    2009-10-10
  • javascript 網(wǎng)頁(yè)上跳動(dòng)的文字

    javascript 網(wǎng)頁(yè)上跳動(dòng)的文字

    網(wǎng)頁(yè)上跳動(dòng)的文字,代碼稍復(fù)雜,效果挺可愛(ài)的,一跳一跳的文字,真逗人!
    2009-10-10
  • JavaScript 平滑文字閃爍

    JavaScript 平滑文字閃爍

    基于JavaScript的平滑文字閃爍,不是單純的閃爍,貌似還帶有一點(diǎn)點(diǎn)別的效果,比如淡入/淡出,那些顏色值你是可以變的,改成你想要的,還有閃爍間隔等,都可以修改的.
    2009-10-10

最新評(píng)論