【发布时间】:2017-06-13 04:40:21
【问题描述】:
我为这个问题创建了一个简单的 JSFiddle。链接在这里: https://jsfiddle.net/tnkh/Loewjnr3/
CSS:
.container{
background: white;
display:flex;
justify-content: center;
align-items: center;
height:50px
}
.circle {
display: inline-block;
width: 20px;
height: 20px;
background: #0f3757;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
border-radius: 50px;
margin-left:10px;
float:left;
transition: all 0.3s ease
}
.circle:hover {
background:orange;
}
基本上在这里,我可以将鼠标悬停在任何圆圈上以更改其颜色。我想问一下,在鼠标移到白色容器后,我怎样才能使橙色停留在我悬停的任何特定圆圈上?
我可以使用任何脚本或 CSS 动画来解决这个问题吗?
【问题讨论】:
-
那么,当你搬出白色容器时,它应该被移除吗?
-
@GuruprasadRao 不,悬停效果应该保持打开
标签: javascript jquery html css