【发布时间】:2019-04-18 23:33:40
【问题描述】:
我有一个 BootStrap 按钮,我在 React 中进行渲染,它有一个属性,也就是一个确定它是否被禁用的条件:
<Button bsClass="fill"
disabled={!props.purchaseble}
onClick={console.log("clicked!")}
>Order now</Button>
在没有 CSS 类的情况下它可以正常工作,但是当用户将鼠标悬停在它上面时它会动画,即使它被禁用:
这是我的按钮 CSS 代码
.fill:hover {
color: whitesmoke;
cursor: pointer;
}
.fill:before {
cursor: pointer;
content: "";
position: absolute;
background: #5a320b;
bottom: 0;
left: 0;
right: 0;
top: 100%;
z-index: -1;
-webkit-transition: top 0.09s ease-in;
}
.fill:hover:before {
cursor: pointer;
top: 0;
}
即使这些动画被禁用,这些动画是否仍然有效,是否有解决方法,因此在禁用时动画不会出现?
【问题讨论】:
标签: html css reactjs twitter-bootstrap