当一个跑马灯从屏幕上离开后,经过短暂的时间间隔,它会从另一侧进入。有没有办法缩短这个时间?
当一个跑马灯从屏幕上离开后,想要尽可能快速地让其从另一侧进入,可以通过减少转换时间来实现。具体来说,可以尝试减少跑马灯完全消失和重新进入屏幕之间的时间间隔。当一个跑马灯从屏幕上离开后,经过短暂的时间间隔,它会从另一侧进入。有没有办法缩短这个时间?
当一个跑马灯从屏幕上离开后,想要尽可能快速地让其从另一侧进入,可以通过减少转换时间来实现。具体来说,可以尝试减少跑马灯完全消失和重新进入屏幕之间的时间间隔。<marquee behavior=scroll direction="left" scrollamount="5">Your message here</marquee>
scrollamount 控制文本滚动的速度:值越高,滚动速度越快。
我们可以通过使用scrollamount
属性来控制滚动速度。
示例:
<marquee scrollamount="30">scrolling fast</marquee>
<marquee scrollamount="2">scrolling slow</marquee>
注意:如果您指定最小数量,滚动速度将减慢,反之亦然。
这个属性以毫秒为单位表示时间。
延迟: 100 毫秒
<marquee scrolldelay="100">Scrolling text</marquee>
延迟:400毫秒
<marquee scrolldelay="400">Scrolling text</marquee>
没有专门控制它的属性。无论如何,跑马灯标签并不是非常可靠的。您可能需要考虑使用 jQuery 和 .animate() 函数。如果您有兴趣探索这个方向并需要代码,请让我知道。
scrolldelay
减慢了整个动画,而不仅是文本从一侧滚动到另一侧之间的延迟。请参见该网页上的示例。 - Dan J<marquee scrollamount=4>Scrolling text</marquee>
阅读更多:http://code2care.org/pages/marquee-tag-scrollamount/
http://www.htmlcodetutorial.com/_MARQUEE_SCROLLAMOUNT.html
附注:避免使用跑马灯!
scrolldelay="number"
<marquee style="font-family: lato; color: #FFFFFF" bgcolor="#00224f" scrolldelay="400">Now the Speed is Delay to 400 Milliseconds</marquee>
<marquee scrollamount="Integer number">scrolling fast</marquee>
scrollamount
OR
scrolldelay
<marquee scrollamount="1">SLOW TEXT</marquee>
<marquee>DEFAULT SPEED TEXT</marquee>
<marquee scrollamount="10">FAST TEXT</marquee>
<marquee scrollamount="20">Faster text</marquee>