CSS 闪烁在 Chrome 中不起作用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15647186/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-29 22:12:33  来源:igfitidea点击:

Blink not working in Chrome

cssgoogle-chromeblink

提问by aizaz

I am using blinkin my application to display error message. The problem is that it's working in Firefox but not in Chrome. I don't know what the problem is. How can I make it to work in Chrome?

blink在我的应用程序中使用来显示错误消息。问题是它可以在 Firefox 中运行,但不能在 Chrome 中运行。我不知道是什么问题。我怎样才能让它在 Chrome 中工作?

采纳答案by Kishan_KP

Add following code to your css file,

将以下代码添加到您的 css 文件中,

blink {
-webkit-animation-name: blink; 
-webkit-animation-iteration-count: infinite; 
-webkit-animation-timing-function: cubic-bezier(1.0,0,0,1.0);
-webkit-animation-duration: 1s;
}

回答by tejas

blink, .blink {
    -webkit-animation: blink 1s step-end infinite;
    -moz-animation: blink 1s step-end infinite;
    -o-animation: blink 1s step-end infinite;
    animation: blink 1s step-end infinite;
}
@-webkit-keyframes blink { 67% { opacity: 0 }}
@-moz-keyframes blink {  67% { opacity: 0 }}
@-o-keyframes blink {  67% { opacity: 0 }}
@keyframes blink {  67% { opacity: 0 }}

回答by prichrd

It is deprecated so you might try to do it with javascript. Here is an example I made out of jquery for you: http://jsfiddle.net/FPsdy/It is very simple:

它已被弃用,因此您可以尝试使用 javascript 来完成它。这是我为您制作的 jquery 示例:http: //jsfiddle.net/FPsdy/它非常简单:

window.setInterval(function(){
  $('.blink').toggle();
}, 250);

回答by alxgb

Blink is deprecated, and you should not use it.

Blink 已被弃用,您不应使用它。

http://www.w3.org/wiki/HTML/Elements/blink

http://www.w3.org/wiki/HTML/Elements/blink

回答by Deril Raju

Try adding the following lines of code to your css file.

尝试将以下代码行添加到您的 css 文件中。

blink {
   -webkit-animation-name: blink; 
   -webkit-animation-iteration-count: infinite; 
   -webkit-animation-timing-function: cubic- 
    bezierr(1.0,0,0,1.0);
    -webkit-animation-duration: 1s;
  }

This is because many browsers doesn't support few css functions. You should try updating your chrome browser.

这是因为许多浏览器不支持很少的 css 功能。您应该尝试更新您的 chrome 浏览器。

回答by Venugopal Nogaja

Only need to import is a jquery.min.js file to use this code.

只需导入一个 jquery.min.js 文件即可使用此代码。

window.setInterval(function(){
    $('.blink').css("opacity","0.5");
    window.setTimeout(function(){
        $('.blink').css("opacity","1");
    },750);
}, 1500);