CSS:
body{
font-family:helvetica;
font-size:120%;
}
ul{
margin-bottom:25px;
}
.thing{
opacity:0;
padding:25px;
background:#e7e7e7;
-ms-animation: fadeStep 0.5s ease forwards;
-webkit-animation: fadeStep 0.5s ease forwards;
-moz-animation: fadeStep 0.5s ease forwards;
-o-animation: fadeStep 0.5s ease forwards;
animation: fadeStep 0.5s ease forwards;
margin:10px;
float:left;
width:20%;
}
li{
list-style:none;
display:inline;
}
a{
padding:10px;
background:grey;
color:#fff;
}
@-webkit-keyframes fadeStep{ 0%{ opacity: 0; } 100%{ opacity: 1;}}
@-moz-keyframes fadeStep{ 0%{ opacity: 0; } 100%{ opacity: 1;}}
@-o-keyframes fadeStep{ 0%{ opacity: 0; } 100%{ opacity: 1;}}
@keyframes fadeStep{ 0%{ opacity: 0; } 100%{ opacity: 1;};
出于某种原因,在webkit浏览器上,只要使用jQuery触发.hide()或.show()函数,动画就会触发。但在Firefox中,它似乎只运行一次。
参见jQuery / HTML&在这里:http://codepen.io/jonboldendesign/pen/LgEaj
答案 0 :(得分:1)