無(wú)間斷滾動(dòng)效果 htc
來(lái)源:易賢網(wǎng) 閱讀:792 次 日期:2016-06-15 09:31:49
溫馨提示:易賢網(wǎng)小編為您整理了“無(wú)間斷滾動(dòng)效果 htc”,方便廣大網(wǎng)友查閱!

marquee.htc

代碼如下:

// 描述 : 無(wú)間斷滾動(dòng)字幕

// 版本 : 2.0

// 作者 : 寶玉(webuc.net)

// 最新更新 : 2004-10-26

// 備 :

<public:component>

<public:attach event=oncontentready onevent=f_init() />

<public:attach event=onpropertychange onevent=f_propchange() />

<public:property name=direction />

<public:property name=speed />

<public:property name=delay />

<public:method name=marquee/>

<public:method name=stop/>

<public:method name=start/>

</public:component>

<script language=jscript>

var _omarqueecontent;

var _omarquee;

var _speed = 2;

var _orientation;

var _direction = up;

var _contentwidth;

var _contentheight;

var _marqueewidth;

var _marqueeheight;

var _paddingtop;

var _firstnode = 1;

var _count = 0;

var _timer = null;

var _pause = false;

var _marqueeinterval = 100; // 滾動(dòng)間隔

var _delayinterval = 2000; // 標(biāo)題顯示延遲間隔

//+----------------------------------------------------------------------------

// function: f_init

// description: 初始化

// parameters: null

// returns: null

//-----------------------------------------------------------------------------

function f_init()

{

_omarquee = document.createelement(div);

_omarqueecontent = document.createelement(span);

_omarqueecontent.innerhtml = element.innerhtml;

_omarquee.appendchild(_omarqueecontent);

element.innerhtml = ;

element.appendchild(_omarquee);

if(speed == null) speed = _speed;

speed = parseint(speed);

if(!speed) speed =_speed;

if(delay == null) delay = _delayinterval;

delay = parseint(delay);

if(!delay) delay = _delayinterval;

if(direction == null) direction =_direction;

direction = direction.tolowercase();

if(direction != left && direction != right && direction != up && direction != down)

direction = _direction;

_orientation= (direction == left || direction == right) ? horizontal : vertical

initmarquee();

marquee();

}

function initmarquee()

{

_marqueewidth = _omarquee.offsetwidth;

_marqueeheight = _omarquee.offsetheight;

_count = _omarqueecontent.children.length;

_contentwidth = _omarqueecontent.offsetwidth;

_contentheight = _omarqueecontent.offsetheight;

_paddingtop = _omarquee.offsettop;

fillmarquee()

_omarqueecontent.style.position = relative;

_omarqueecontent.style.pixeltop = 0;

}

function fillmarquee()

{

var children = _omarqueecontent.children;

var i = 0;

if (_orientation== horizontal)

{

while (_omarqueecontent.offsetwidth < _contentwidth + _marqueewidth)

{

_omarqueecontent.appendchild(children[i++].clonenode(true));

}

}

else

{

while (_omarqueecontent.offsetheight < _contentheight + _marqueeheight)

{

_omarqueecontent.appendchild(children[i++].clonenode(true));

}

}

}

function marquee()

{

if (_pause)

return;

switch(direction)

{

case up:

_omarqueecontent.style.pixeltop -= speed;

if(math.abs(_omarqueecontent.style.pixeltop + _contentheight + _paddingtop) < speed)

_omarqueecontent.style.pixeltop = 0;

if (math.abs(_omarqueecontent.children[_firstnode].offsettop) - _paddingtop < speed)

{

_firstnode++;

if (_firstnode >= _count)

_firstnode = 0;

_timer = window.settimeout(uniqueid + .marquee(), _delayinterval);

}

else

_timer = window.settimeout(uniqueid + .marquee(), _marqueeinterval);

break;

}

}

function stop()

{

cleartimer();

_pause = true;

}

function start()

{

if (_timer != null)

cleartimer();

_pause = false;

marquee();

}

function cleartimer()

{

window.cleartimeout(_timer);

_timer = null;

}

//

// cancels an event

//

function f_cancelevent()

{

event.returnvalue = false;

}

//

// a property changed

//

function f_propchange()

{

switch (event.propertyname)

{

default:

f_redraw();

break;

}

}

//

// forces a redraw of the control

//

function f_redraw()

{

}

</script>

html文件

代碼如下:

<style>

body,td{

font-size:9pt;

}

.marquee{

overflow-y:hidden;word-break:break-all;padding:10px;

behavior:url('marquee.htc');

}

.marquee div{

padding-bottom:10px;

}

</style>

無(wú)間斷滾動(dòng)<br />

每個(gè)標(biāo)題間有停留<br />

鼠標(biāo)移入停止,鼠標(biāo)移出繼續(xù)滾動(dòng)<br />

<span style=height:100px;width:200px;border:1px solid black; delay=3000 class=marquee onmouseover=this.stop() onmouseout=this.start()>

<div><a href= target=_blank>1. 寶玉()作品</a></div>

<div><a href= target=_blank>2. 強(qiáng)強(qiáng)聯(lián)手,助推上海建筑領(lǐng)域信息化建設(shè)</a> </div>

<div><a href= target=_blank>3. 廣聯(lián)達(dá)清單招標(biāo)投標(biāo)策略研討會(huì)——河南站圓滿成功</a> </div>

<div><a href= target=_blank>4. 足球友誼賽:河北電建一公司 vs 廣聯(lián)達(dá)石家莊分公司</a> </div>

<div><a href= target=_blank>5. 廣聯(lián)達(dá)——清單算量軟件 gcl7.0新版出爐!</a> </div>

<div><a href= target=_blank>6. 喜報(bào):廣聯(lián)達(dá)公司順利通過(guò)iso9000質(zhì)量管理體系三年復(fù)審</a> </div>

<div><a href= target=_blank>7. 廣聯(lián)達(dá)-清單整體解決方案在北京求實(shí)造價(jià)咨詢公司的成功應(yīng)用</a> </div>

<div><a href= target=_blank>8. 廣聯(lián)達(dá)-施工項(xiàng)目成本管理系統(tǒng)(gcm)在榮尊堡工程中的應(yīng)用</a> </div>

<div><a href= target=_blank>9. 廣聯(lián)達(dá)-工程概預(yù)算軟件在北京建工集團(tuán)總公司東方廣場(chǎng)工程的應(yīng)用</a> </div>

<div><a href= target=_blank>10. asdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff</a> </div>

</span>

<script>

</script>

更多信息請(qǐng)查看腳本欄目
易賢網(wǎng)手機(jī)網(wǎng)站地址:無(wú)間斷滾動(dòng)效果 htc
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

2025國(guó)考·省考課程試聽(tīng)報(bào)名

  • 報(bào)班類型
  • 姓名
  • 手機(jī)號(hào)
  • 驗(yàn)證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 加入群交流 | 手機(jī)站點(diǎn) | 投訴建議
工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報(bào)警專用圖標(biāo)