我想当每个<li>
结束字幕停止几秒钟,然后继续下一个 <li>
.这是我的代码:
<div id="teks_container" >
<marquee direction="up" scrollamount="3" height="200px">
<ul>
<li><strong><p align="justify">
I was wondering if it's possible</strong> to create HTML Rolling Credits in a website. If so, how do I need to do? Thanks
</p></li><br/>
<li><strong><p align="justify">
I was wondering if it's possible</strong> to create HTML Rolling Credits in a website. If so, how do I need to do? Thanks
</p></li><br/>
<li><strong><p align="justify">
I was wondering if it's possible</strong> to create HTML Rolling Credits in a website. If so, how do I need to do? Thanks
</p></li><br/>
<li><strong><p align="justify">
I was wondering if it's possible</strong> to create HTML Rolling Credits in a website. If so, how do I need to do? Thanks
</p></li><br/>
</ul>
</marquee>
</div>
最佳答案
您可以使用this.start()
和this.stop()
来暂停和启动跑马灯
。
var start = true;
setInterval(passStartMarquee, 1500 );
// adjust the delay
function passStartMarquee() {
if (start) {
document.querySelector('marquee').start();
start = false;
} else {
document.querySelector('marquee').stop();
start = true;
}
}
<div id="teks_container" >
<marquee direction="up" scrollamount="3" height="200px">
<ul>
<li ><strong><p align="justify">
I was wondering if it's possible</strong> to create HTML Rolling Credits in a website. If so, how do I need to do? Thanks
</p></li><br/>
<li><strong><p align="justify">
I was wondering if it's possible</strong> to create HTML Rolling Credits in a website. If so, how do I need to do? Thanks
</p></li><br/>
<li><strong><p align="justify">
I was wondering if it's possible</strong> to create HTML Rolling Credits in a website. If so, how do I need to do? Thanks
</p></li><br/>
<li><strong><p align="justify">
I was wondering if it's possible</strong> to create HTML Rolling Credits in a website. If so, how do I need to do? Thanks
</p></li><br/>
</ul>
</marquee>
</div>
我宁愿使用 jquery 选取框 slider 。因为它将跨浏览器兼容。
关于javascript - 如何暂时停止字幕文本然后继续?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29405091/