简体   繁体   English

悬停时的不透明度在Chrome或IE中不起作用

[英]Opacity on hover not working in Chrome or IE

Urg! URG! I'm using a WordPress plugin to create boxes with an opacity effect upon hover but it doesn't seem to work on Chrome or IE and instead they fades to opacity: 1 (100%) although I have modified the CSS to opacity: 0.2 我正在使用WordPress插件创建具有悬停效果的盒子,但它似乎无法在Chrome或IE上正常工作,而是将其淡化为不透明度:1(100%),尽管我已将CSS修改为不透明度:0.2

Works well on Safari and Firefox but not Chrome or IE. 在Safari和Firefox上效果很好,但在Chrome或IE上效果不佳。 Could this be a webkit issue? 这可能是webkit问题吗?

Boxes below the slider: http://goo.gl/5IkgSF 滑块下方的框: http : //goo.gl/5IkgSF

That is because the opacity that you're trying to change is within keyframes so you need to modify the keyframes or add new keyframes to override the plugin's style. 这是因为您要更改的不透明度在关键帧内,因此您需要修改关键帧或添加新的关键帧以覆盖插件的样式。

In the animate.css line 517 you can find the following code, change the opacity from 1 to .2 as the following and it will work fine. animate.css517行中,您可以找到以下代码,将不透明度从1更改为.2 ,如下所示,它将正常工作。

@-webkit-keyframes fadeIn {
    0% {opacity: 0;}    
    100% {opacity: .2;}
}

@-moz-keyframes fadeIn {
    0% {opacity: 0;}    
    100% {opacity:  .2;}
}

@-o-keyframes fadeIn {
    0% {opacity: 0;}    
    100% {opacity: .2;}
}

@keyframes fadeIn {
    0% {opacity: 0;}    
    100% {opacity:  .2;}
}

.fadeIn {
    -webkit-animation-name: fadeIn;
    -moz-animation-name: fadeIn;
    -o-animation-name: fadeIn;
    animation-name: fadeIn;
    /* opacity: .2; */
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM