单行文字滚动,单行文字轮播,文字轮播JS代码,一行代码实现文字轮
作者:
hi__world | 来源:发表于
2018-10-08 09:17 被阅读130次<style>
div.screen {width: 100%;height: 40px;overflow: hidden;} a.textA {text-decoration: none;display: block;height: 40px;line-height: 40px;color: transparent;transition: all 2s} a.textA:first-child {margin-top: -40px;}a.textA:nth-child(2) {color: #000;}
</style>
<div class="screen">
<a class="textA" href="https://www.baidu.com">老和尚非要给小和尚讲故事 </a><!-- 第五句话 -->
<a class="textA" href="http://www.baidu.com">从前有一座山,山上有一座庙 </a><!-- 第一句话 -->
<a class="textA" href="http://www.baidu.com">庙里有一个老和尚和一个小和尚</a><!-- 第二句话 -->
<a class="textA" href="http://www.baidu.com">老和尚在给小和尚讲故事 </a><!-- 第三句话 -->
<a class="textA" href="http://www.baidu.com">小和尚不想听老和尚讲故事 </a><!-- 第四句话 -->
</div>
<script>
setInterval(function () { document.getElementsByClassName("screen")[0].appendChild(document.querySelector('.textA')); }, 2800);
</script>
本文标题:单行文字滚动,单行文字轮播,文字轮播JS代码,一行代码实现文字轮
本文链接:https://www.haomeiwen.com/subject/cardaftx.html
网友评论