此处写法是

css===写好样式放在一个新class名

1 @keyframes flipping{
2     from{transform:rotateY(0);}
3     to{transform:rotateY(180deg);}
4 }
5 .active{
6     animation: flipping .6s ease-in;
7 }

js===点击时给要翻转的元素添加class名称。

$(function(){
    $("#gold li img").click(function(){
        // $(this).addClass("active")
        this.className="active"
       
    //此处有$(this)和this,使用注意事项
    //可到此链接查看:https://www.cnblogs.com/gfl123/p/8080484.html
    })
})

 

相关文章:

  • 2021-11-09
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2021-09-13
  • 2022-01-24
  • 2021-05-19
猜你喜欢
  • 2022-12-23
  • 2021-07-29
  • 2022-01-06
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
相关资源
相似解决方案