作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用从右侧到左侧的选取框滚动。下面的代码工作正常。但它滚动不流畅。 “Hover on me to stop”内容闪烁或闪烁。我需要一个 100% 平滑的卷轴用于下面的选取框。请帮我。没有javascript是否可行??
<marquee behavior='scroll' direction='left' scrollamount='3' onmouseover='this.stop()' onmouseout='this.start()'>Hover on me to stop</marquee>
最佳答案
如果您想尝试使用纯 CSS,那么这是最简单的方法。尽管您需要检查对旧浏览器的支持并添加供应商前缀。
.marquee-parent {
position: relative;
width: 100%;
overflow: hidden;
height: 30px;
}
.marquee-child {
display: block;
width: 147px;
/* width of your text div */
height: 30px;
/* height of your text div */
position: absolute;
animation: marquee 5s linear infinite; /* change 5s value to your desired speed */
}
.marquee-child:hover {
animation-play-state: paused;
cursor: pointer;
}
@keyframes marquee {
0% {
left: 100%;
}
100% {
left: -147px /* same as your text width */
}
}
<div class="marquee-parent">
<div class="marquee-child">
Hover on me to stop
</div>
</div>
关于html - 选取框滚动不流畅,选取框需要 100% 平滑滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18417056/
在下面的代码中,我想不必添加undefined作为filteredDevice的类型注解。我认为一个被过滤的设备不应该是未定义的,因为我过滤掉了未定义的设备。 但是如果我删除 undefined类型注
我有一个 UIButton,其文本来自服务器。按钮的宽度是固定的。我想要的是,如果按钮的文本超过按钮的宽度,文本应该在按钮内选取框。如果文本适合按钮宽度,则不应有选取框效果。 我点击了一些链接(one
我正在从头开始实现 webgl 选取,并决定走 GLSL 路线,而不是光线相交测试。 所以我将整个场景渲染到一个单独的帧缓冲区中,为每个对象分配一个唯一的颜色,该颜色作为统一变量传递给片段着色器。当场
例如,我有包含多个对象的数组, var arr = ["a", "b", "c", "d"]; 我想要的是从该数组中选取 2 个随机对象,例如“a”和“c”,并将这 2 个对象推送到另一个数组中,例如
我是一名优秀的程序员,十分优秀!