盒子翻转总结

一般情况下需要翻转的盒子是排列着的 所以 在li中套两个盒子,分别为front 和 back 

css部分

.front{

    position: absolute;

    background-position: 0 bottom;

}

.back{

    position: absolute;

    backface-visibility: hidden !important;

    -moz-backface-visibility: hidden !important;

    -ms-backface-visibility: hidden !important;

    -webkit-backface-visibility: hidden !important;

    transition: all 0.2s;

    -moz-transition: all 0.2s;

    -o-transition: all 0.2s;

    -webkit-transition: all 0.2s;

    background-position: -305px bottom;

    transform: rotateY(180deg);

    -ms-transform: rotateY(180deg);

    -moz-transform: rotateY(180deg);

    -o-transform: rotateY(180deg);

    -webkit-transform: rotateY(180deg);

}

js部分:

$('.front').mouseover(function(){

        $(this).removeClass('fanzhuan1').addClass('fanzhuan2');

        $(this).next().addClass('fanzhuan1');

    })

    $('.back').mouseleave(function(){

        $(this).removeClass('fanzhuan1').addClass('fanzhuan2');

        $(this).prev().addClass('fanzhuan1');

    })

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 第一种方式: 首先,我们在html中有这样一个布局: 不要小看外面那个div,它可是本次内容不可少的呢,没了它,后...
    心羽女性减压阅读 9,778评论 1赞 2
  • W3C标准中对css3的transition这是样描述的:“css的transition允许css的属性值在一定的...
    青春前行阅读 1,582评论 0赞 5
  • 选择qi:是表达式 标签选择器 类选择器 属性选择器 继承属性: color,font,text-align,li...
    love2013阅读 2,502评论 0赞 11
  • 程风起,后来我才知道你是摄影师。 原来你也和我一样,四处奔波,采集风景。我用画笔绘制,你用镜头定格,我们都在描...
    dda44ad7a64c阅读 655评论 0赞 2
  • 第二天,周阳家的七大姑八大姨都来看陶然了。说是看陶然,其实是看孩子的。第一个进门的是周阳的姐姐周静。人还没到,就听...
    佑多阅读 410评论 0赞 1

友情链接更多精彩内容