问题
I am using blink
in 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?
回答1:
Add following code to your css file,
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;
}
回答2:
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 }}
回答3:
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:
window.setInterval(function(){
$('.blink').toggle();
}, 250);
回答4:
Blink is deprecated, and you should not use it.
http://www.w3.org/wiki/HTML/Elements/blink
回答5:
Try adding the following lines of code to your css file.
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.
回答6:
Only need to import is a jquery.min.js file to use this code.
window.setInterval(function(){
$('.blink').css("opacity","0.5");
window.setTimeout(function(){
$('.blink').css("opacity","1");
},750);
}, 1500);
来源:https://stackoverflow.com/questions/15647186/blink-not-working-in-chrome