是否可以更改 HTML 的 <marquee> 标签的速度?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4227462/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Is it possible to change the speed of HTML's <marquee> tag?
提问by aaaaa
When one marquee leaves the screen then after a short time gap it enters from another side. Is there any way to reduce this time?
当一个选取框离开屏幕时,经过一小段时间后,它从另一侧进入。有什么办法可以减少这个时间吗?
回答by Ashish Anand
<marquee behavior=scroll direction="left" scrollamount="5">Your message here</marquee>
scrollamount controls the speed of text: higher the value higher is the scrolling speed
scrollamount 控制文本的速度:值越高滚动速度越高
回答by sakthideveloper
we can control the scrolling speed by using the scrollamount
attribute,
我们可以通过使用scrollamount
属性来控制滚动速度,
Example:
例子:
<marquee scrollamount="30">scrolling fast</marquee>
<marquee scrollamount="2">scrolling slow</marquee>
note:if you specify the minimum number, the scrolling speed will be reduce vice versa
注意:如果您指定最小数量,则滚动速度将降低,反之亦然
回答by Abu Sufian
This attribute takes the time in milliseconds.
此属性花费的时间以毫秒为单位。
Delay : 100 Milliseconds
延迟:100 毫秒
<marquee scrolldelay="100">Scrolling text</marquee>
Delay : 400 Milliseconds
延迟:400 毫秒
<marquee scrolldelay="400">Scrolling text</marquee>
回答by James Thompson
There isn't specifically an attribute to control that. Marquee isn't a highly reliable tag anyways. You may want to consider using jQuery and the .animate() function. If you are interested in pursuing that avenue and need code for it, just let me know.
没有专门的属性来控制它。无论如何,Marquee 并不是一个高度可靠的标签。您可能需要考虑使用 jQuery 和 .animate() 函数。如果您有兴趣追求该途径并需要代码,请告诉我。
回答by AcousticHead
You can change the speed of marquee tag using scrollamountattribute.
您可以使用scrollamount属性更改选取框标记的速度。
It accepts integer values 6 being the default speed, so any value lower then 6 will slow down the marquee effect.
它接受整数值 6 作为默认速度,因此任何低于 6 的值都会减慢选取框效果。
Example :
例子 :
<marquee scrollamount=4>Scrolling text</marquee>
Read more : http://code2care.org/pages/marquee-tag-scrollamount/
阅读更多:http: //code2care.org/pages/marquee-tag-scrollamount/
http://www.htmlcodetutorial.com/_MARQUEE_SCROLLAMOUNT.html
http://www.htmlcodetutorial.com/_MARQUEE_SCROLLAMOUNT.html
P.S : Avoid using marquee!
PS:避免使用选框!
回答by Uday Kumar
You can Change the speed by adding scrolldelay
您可以通过添加滚动延迟来更改速度
<marquee style="font-family: lato; color: #FFFFFF" bgcolor="#00224f" scrolldelay="400">Now the Speed is Delay to 400 Milliseconds</marquee>
回答by Nadeem Bhat
In Order to increase speed of your Marquee text you just need to add like this in your code below:
为了提高您的选取框文本的速度,您只需要在下面的代码中添加如下内容:
<marquee scrollamount="Integer number">scrolling fast</marquee>
回答by John Giotta
scrolldelay="number"
scrolldelay="number"
回答by sad
To increase scroll speed of text use attribute
要提高文本使用属性的滚动速度
scrollamount
OR
scrolldelay
in the 'marquee' tag. place any integer value which represent how fast you need your text to move
在“选框”标签中。放置任何整数值,代表您需要文本移动的速度
回答by Rojith Thomas
<body>
<marquee direction="left" behavior=scroll scrollamount="2">This is basic example of marquee</marquee>
<marquee direction="up">The direction of text will be from bottom to top.</marquee>
</body>
use scrollamount to control speed..
使用滚动量来控制速度..