4 个回答

.hvr-grow {

        display: inline-block;
        vertical-align: middle;
        -webkit-transform: perspective(1px) translateZ(0);
        transform: perspective(1px) translateZ(0);
        box-shadow: 0 0 1px transparent;
        -webkit-transition-duration: 0.3s;
        transition-duration: 0.3s;
        -webkit-transition-property: transform;
        transition-property: transform;
    }
    .hvr-grow:hover, .hvr-grow:focus, .hvr-grow:active {
        -webkit-transform: scale(1.1);
        transform: scale(1.1);
    }

demo,demo使用transtion搭配transform做的动画,触发用:active伪类做的。效果方式可以长按加号可以看到效果。改进方式,使用animations可以让动画连贯起来,也可以不用长按。

方法2就是用js绑定一下onclick事件。然后或者用animations做。或者用位置的变化模拟。问题应该都不大吧。

click事件加上border;width 和 height =原来的减去border,border用背景的相近色

.add:active{
     opacity: .7;
     margin-top:-1px;
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题