animation: name duration timing-function delay iteration-count direction;
定義動畫:
@keyframes mymove
{
from {left:0px;border-left: 0px solid #d91f24;}
to {left:3px;border-left: 4px solid #d91f24; box-shadow: 0px 0px 20px rgba(150, 150, 150, 0.4);}
}
@-webkit-keyframes mymove /*Safari and Chrome*/
{
from {left:0px;border-left: 0px solid #d91f24;}
to {left:3px;border-left: 4px solid #d91f24;box-shadow: 0px 0px 20px rgba(150, 150, 150, 0.4);}
}
經過添加類的方式觸發:
.brand_li{
animation:mymove 450ms ;
-webkit-animation:mymove 450ms ; //infinite 循環播放
animation-fill-mode: forwards; //定格在動畫播放完以後
}
jq添加類:
$(".list_content>ul>a>li").hover(
function(){
$(this).addClass("brand_li");
},
function(){
$(this).removeClass("brand_li");
}
)