首页 > 其他 > 详细

图片点击翻转效果

时间:2018-09-06 18:50:00      阅读:189      评论:0      收藏:0      [点我收藏+]

此处写法是

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
    })
})

 

图片点击翻转效果

原文:https://www.cnblogs.com/Millet-23/p/9600225.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!